When I was 16 or 17 (always looked a bit younger and kinda like "a pretty boy"), some random gay guy (around his 40-ties) groped me in public bus. That a**ole was definitely a pro, because initially I did not notice what was going on - and that bus was crowded by the way... Jerk had some sort of large file pad and was covering his actions and being so discreet that when I finally figured out what he was up to (cause he started to breath in very ugly manner), so I kinda froze. I pretty much hated all gays for a long time, but that is another story. If that would happened now, I pretty much would either push him away or make him suffer - like stepping on his toes and making sure I stay there. Being in a publicē bus is kinda double-edged stick...
Now, lets say I was alone somewhere... This is tricky. I do carry pepper spray quite often and been over decade in martial arts, but since the HRT kicked into its full effect, both agression and self-confidence have taken some ,,damage". Pre-HRT I was quite confident in handling two medium-trained attackers – or three medium built guys from the street (unarmed of course), but now doing that would require some extra feats. Martial arts do provide some mental conditioning and confidence boost. Also, Estrogen cools down Your brain a bit and it is kinda good when You dont get into that ballistic mode, which testosterone + adrenaline sends You in as soon as there is some serious danger. Sure, it also gives that strenght multiplier plus ,,bullet-time" (You know, everything just freezes down a bit), but sometimes it all ends in way too much recklessness and aggression...
But for that clear and cool head to work in getting You out of trouble, You will need some basic training. What always work, despite lack of physical strenght, is pressure points and causing lots of pain with minimum efforts. That means – learn to fight dirty and dont be ashamed of that. I never was, and if there were many attackers, I was sure to punch at least one of them in his balls as hard as I could (thats guaranteed minus one dude) and then trying to get away in the cleared spot until others have realised what is going on.
The good thing (if there is anything good about aggression) is that violence against a man starts with a punch, but violence against a woman starts with a grab or hold – You probably noticed that already. So if You are grabbed - start by being aloud and visible to others – in many cases people might assume that he is Your boyfriend and You two are just having a hard time – and will not interfere. Make it clear that You are not with him and are actually a woman in distress. If You need to push away someone who is stronger or heavier than You – then pain is Your asset. Bite his lip or cheek or ear as hard as You can, if he forces You into something – grab and squeeze (and he will go down), or even punch him there. Dont start doing fancy things, because most of them wont work if You have not practiced them, besides if he is too excited he might be full with adrenaline and wont register the pain. Slapping is quite useless, because he might get angry... Actually, backhanding across his face can have devastating effect, but You need to practice that, because You actually aim for his eyes and tip of nose and You hit him with the tip of fingers, not Your hand (the pain is terrible, btw)...
Poking in the eye does wonders too. If You are not grabbed, then maintain the distance by backing away and sideways, and making Yourself being heard.
It is kinda tough game, and the best way to avoid it is by being alert and aware of Your surroundings and sticking to the crowd, because when You are alone You would have to rely on Your own assets – and You gotta make sure they are good (and they will be always worse than his... sorry) and rely on surprise and shock element.