People are confusing moral and legal rights.
Women absolutely have the moral right to nut-knee someone who says that to them. I wouldn't stop them or testify against them.
People generally don't have the legal right to do that. If someone tries that and gets sued, it will be up to them to prove that there was an imminent credible threat. If the guy is still alive, they'll be able to claim that YBMC is just a joke and it would be up to the victim to prove that it wasn't.
Laws constantly need to catch up.
I'm not sure what law would be an improvement though. The courts tend to frown on laws that are directed at specific groups of people so you probably couldn't have something as specific as, "When a man says YBMC to a woman she's allowed to consider it a rape threat and knee him in the nuts." It also wouldn't be terribly effective since those people would likely find some variation that skirts the law but carries exactly the same message. That's so common a tactic we even have a name for it, "dogwhistles".
The most general form is a "stand your ground" law. Ie we don't question the motives of the "defender", we just assume they were right. That has some obvious issues too.
There might be something between those two that would work, but I don't know what it would be.