It's difficult to measure rape statistics across countries. But we know, that if guns were prophylactic to rape, the US should have a disproportionately low statistic. It does not.
And anybody who knows about rape knows that guns are impotent to stop the vast majority. That's because a large portion of rape victims support and protect their attacker because it's somebody they love.
But sure, in an 80s action move fantasy, a woman with a gun is safe I guess.
It's a super easy trope to default to. It's basically removing the chaos from mental scenarios to make it more palatable and voiding the evolutionary utility in having those thoughts in the first place. Seems like it's more or less a coping mechanism for things likely to be out of our control.