EDIT: Here's one paper that talks about how "widely shared cultural beliefs about gender" affect early decisions people make wrt to their careers https://sociology.stanford.edu/sites/g/files/sbiybj9501/f/pu...
"The results of this study show that males assess their own mathematical competence higher than their otherwise equal female counterparts"
"self-assessments of task competence were found to influence career-relevant decisions, even when controlling for commonly accepted measures of ability. For males and females, the higher they rate their mathematical competence, the greater the odds that they will continue on the path leading to careers in the quantitative professions. However, since males tend to overestimate their mathematical competence relative to females, males are also more likely to pursue activities leading down a path toward a career in science, math, and engineering."