This WILL be controversial so I'm sorry for offending anyone. I' only just putting it out there and it feels like I NEED to.
In Islam, if someone commits rape and they're not married, they literally get whipped at their back one hundred times regardless of the circumstances. If married, they get stoned to death. Regardless of gender, status, anything. That is if they're guilty of course.
I have never heard of this specific punishment being applied anywhere in the entire world in the modern era.
But fixed, severe consequences can well prevent the action. Even if one indiviual does it once and is never caught, I bet they would never dare try it again if the judicial and policeing systems are consistent enough.
Just putting it out there.