It's almost as if people forget that there are stalls with locks on them.
Someone that identifies as a certain sex goes into a stall in that bathroom, shuts the door, locks it, uses the facilities, flushes, unlocks the door, washes their hands, and leaves.
No big deal.