...anytime you need to hit anyone in self defense, that's when. To imagine that someone gets a pass for aggression due to the type of genitalia they have is inconsistent and hurts everyone- attacker and victim, alike.
You are never obligated to defend yourself with violence, but on the other hand, you are also never obligated to sit back and take it. Not from anyone, ever.
I have never bought into this "never hit a woman" nonsense. Yet, I have refrained from hitting a woman a couple of times it was justified. Simply because I knew "the law" wouldn't have been on my side due to a total lack of witnesses. I'm not proud of that fact. There is nothing noble about allowing yourself to be hit while doing nothing to defend yourself.
When my second marriage was getting really bad, my (newly psychotic) wife would occasionally slap me and dare me to do something about it. I did- I got away. But I would have been right to have punched her, and am somewhat ashamed that I didn't. You and I both know I would have been arrested for defending myself, since her aggression happened in the privacy of our home. It doesn't matter, though. As the aggressor she deserved to be defended against with whatever amount of violence it took to stop the attack.
Refusing to hit her could also be seen as a form of self defense- defense against insane "laws" and bigotry. Choosing one violation to avoid a potentially worse one.
So, no, I have never hit a woman, but I will never condemn someone who hits an aggressor of any sex. Sometimes it is simply the right thing to do. If that offends you, well, suck it up, Buttercup.