How do you squat whilst also holding your trousers up so they don't get wet on the pee below, whilst also trying not to stand in it and making sure that your bags are up off floor level but also not going to get pinched?
Do you want advice for squatting in the wilderness, or for squatting over a loo?
Okay, loo first:
Bags: I use a backpack. Women's loos often have hooks you can use for your handbag, or at least they do, here. But if you expect to encounter adverse conditions, always opt for a backpack.
Trousers: The dirty floor problem is avoided by trousers tight enough around the ankles so they don't slide over your shoes.
The dirty toilet problem is a problem if you can't stand far enough away from the toilet, which is a problem in very small loos; I have no solution to it.
Skirts are sometimes easier kept clean in small, dirty toilets, by just pulling them up to waist level before entering the cubicle. It goes without saying that this is NOT possible in unisex loos.
(Keeping the underpants away from the dirty toilet is a problem with that method; that's how I understood for the first time why women didn't use to wear underpants)
Wilderness is much easier. You squat lower so the pee is well away from your trousers and feet, and choose the location so the pee won't pool at your feet. Some women find skirts easier for wilderness peeing.