Headphones also give an 'excuse'. Some men become really pissy and unstable if they think you're ignoring them, but if you have visible headphones, then you have the excuse of not hearing them.
I don't know why you're getting downvoted, this is a real issue. I'm not a woman, but I'm a gay man and the same thing happens walking through Boystown or at the gym. Headphones have a near-100% success rate at deflecting unwanted advances.
Unwelcome attention is unwelcome attention. The only charitable exceptions might be children and adults with developmental disabilities, who allowably don’t know any better.