As the father of a 2yr old, I haven't run into this problem yet. But I have thought about it and want to know how others will handle it.
Let's say you're walking around Home Depot with your 5yr old daughter - the wife is back at the house and you are the solo parent. Now let's assume those 2 dozen hot wings you ate the night before start knocking on the door - and it's going to be explosive!
Do you bring the poor kid into the stall with you?
Do you subject them to the awfulness that is about to come out of you?
If so, wouldn't that traumatize them for life?
This problem would exist for any child from age 3-10. Any older and they probably do not need to join you in the bathroom festivities.