There could be some stories in satirical literature. Satire often uses extreme and embarrassing situations to make a point. So, a story might include a girl shitting her pants as a way to highlight the chaos or absurdity of a particular situation or society. But it's not something that is widely explored in a very blatant way in most literature.
One reason could be extreme fear. For instance, if a girl is in a horror - filled situation like being chased by a monster in a fictional horror story. The intense fear can cause her body to lose control. Another reason might be a medical issue that the character has but is not aware of until the embarrassing moment occurs.
There are also stories in some cultures about how to build proper latrines. In some Asian cultures, for instance, the design of the outhouse has been passed down through generations. These stories often involve the importance of proper drainage and ventilation, which can be quite interesting when you hear the details of how people used to manage waste in the old days.
This is a very private and unseemly topic to try to find a positive angle for. We can focus on girls' kindness in helping others in need, for example, in community service or in taking care of the elderly.
Once there was a girl who was on a long road trip. She had been drinking a lot of water along the way. Suddenly, she felt an urgent need to go to the toilet. They were in the middle of nowhere with no proper restrooms in sight. She had to ask the driver to stop by the side of the road. She quickly ran behind some bushes and relieved herself. It was quite an embarrassing yet comical situation for her.
No. These stories often contain disturbing and grotesque elements that are not suitable for children or those with a more sensitive disposition. The themes can be quite extreme and may involve violence and abnormal power dynamics.
Seeing it is not illegal. But the act of a woman shitting in public may be illegal depending on local laws and regulations. In many places, public indecency laws exist to prevent such behavior which violates public order and propriety.