I've asked HOW women are supposed to know that the person standing next to them is a trans woman and not a creepy guy who may be dangerous
What is
your answer to this question? You keep asking it. I don't think there's an answer; there is no good way to know that a stranger is not dangerous. So what should a person do if they find they are unsure of a stranger's intentions?
I think there's a pretty easy way: quit assuming all people with penises are creepy or dangerous.
A slightly more fiddly way is anyone who undergoes a medical procedure that makes it so they no longer produce sperm in their ejaculate can get a card validating that fact, and those without the hardware to produce sperms can get one without effort.
This will largely eliminate the vast majority of special danger presented.
At any rate, you can't validate that the person WITHOUT a penis isn't a creep. At best you can validate that they don't produce sperm. If they harass you in the bathroom the solution is to find building security or HR and get them ejected from the building and/or fired for harassment.
It allows someone to validate that they do not present the special risk of ejaculation of sperms, while denying information about the nature of their genitals beyond the one pertinent fact.