I'm not sure how an opinion could be invalid? Maybe to another, but obviously not to the person who has that opinion.
> asserting that gender has nothing to do with it
Of course it does in her case. I feel bad for her, and it totally sucks. However, this is what trolls do. They troll people for various illogical reasons.
> So let's fix it.
I am not trying to be rude, but this is so naive it is painful. You can't do anything to stop trolls online, especially intelligent technically proficient ones. You can behave respectfully and enforce societal norms in your own office and daily life. That is all you can do. Be a good person in real life and hold people to a reasonable standard.