The problem is it's self-reinforcing. When you have a gender imbalance of something like 10:1, everything bad that happens in the 1:1 case now happens ten times as often even if all the men behave exactly the same. A bad experience that would have occurred to 3.5% of women then occurs to 35%, assuming exactly identical behavior. And worse than that if the bad actors become more aggressive for lack of prospects.
Which means you can't solve it there. You're not going to reduce the number of bad acts to 10% of the general-population level because the good methods of inhibiting bad acts are going to be widely deployed. You can't use them to get a relative advantage.
Probably the only way to fix it is over-representation at the start of the pipeline. Make it so that 75% of high school seniors applying to CS programs are female so that by the time a third of them drop out the gender balance is right, and in ten or fifteen years that will no longer be necessary because then the gender balance at the end of the pipeline is fixed and the female dropout rate goes down.
In your first paragraph you're essentially describing the Matthew Effect. It's one of the strongest arguments against laissez-faire libertarian approaches to unfair/unnatural inequalities.
Your approach is a more aggressive form of affirmative action.
Affirmative action can't work. It isn't that kind of problem. There is no percentage of qualified female applicants you can accept that will put 10 women in 50 seats.
You have to change the culture in middle and high schools so that lots more little girls want to be hackers.
Which means you can't solve it there. You're not going to reduce the number of bad acts to 10% of the general-population level because the good methods of inhibiting bad acts are going to be widely deployed. You can't use them to get a relative advantage.
Probably the only way to fix it is over-representation at the start of the pipeline. Make it so that 75% of high school seniors applying to CS programs are female so that by the time a third of them drop out the gender balance is right, and in ten or fifteen years that will no longer be necessary because then the gender balance at the end of the pipeline is fixed and the female dropout rate goes down.