Make leave mandatory even for people who don't have children, or you're selecting for childless people of either gender. Sometime between 20 and 40 you have to take half a year off.
There should definitely also be mandated minimum vacation days in my opinion (where I live, four weeks of paid leave per year are the legal minimum for full-time jobs), but that's quite unrelated to the issue at hand.