5 months don't look as too much to me; this notwithstanding many businesses only hire young women if they sign a blank resignation letter (which of course is illegal too, but very difficult to prove). I agree it's a very complicated matter.
The best solution imho would be to have more state-subsidized childcare solutions (we have some, but much less than needed), which would make young mothers more productive for employers, but I understand that most free-market advocates wouldn't agree :)
PS Yes I expect to win the case, because my wife's former employer so patently broke the rules. But here in Italy justice is so slow (next month there will be the first hearing, 8 months after we sued) and compensations so little that very often employers get away with it. I decided to go to court more to defend a principle than for an economic reason.