Here's what I would love to see. Take the set of graduates in a given year from some set of universities. Say, AAU
member universities. Identify the graduates who, as high school seniors, met a certain SAT/ACT threshold, with a higher threshold in math, and who also took at least one C.S. or Calculus course in high school. Let's call this set "students who, upon graduating high school, were potential C.S. majors".
First question: what percentage of this set are women? Probably less than 50% given the way it was constructed, but probably higher than 18%, which is percentage of women earning C.S. degrees. Now, take the subset of the women from this set who did
not earn a C.S., Math, Engineering or Physics degree, and
ask them why they didn't pursue one of those fields. I suspect their answers might be interesting. This a group that, on paper, was not disadvantaged either in ability or exposure to C.S./Math. In fact, it's a set whose interest in C.S./Math is likely to be higher than average since C.S./Calculus are almost never required to graduate high school. So, in high school at least, the members of this set showed some interest in C.S./Math. Why, then, did they choose not to pursue either at university? On an aggregate level, what did they pursue instead?
Another interesting avenue of research might be to look at those silly Myers-Briggs personality types. Come up with an expected % of C.S./Math/Engineering/Physics for each type based on actual real-world data. Then examine whether certain types that produce a disproportionate number of workers in those fields are overrepresented among male high school seniors vs. female high school seniors. I'm guessing this would explain
some (but not all) of the gender gap in C.S./Math/Engineering/Physics. As an example, maybe it's the case that there are just way more male INTPs than female INTPs and the INTP type tends to disproportionately favor those fields.