Personally, I think infanticide by a mother in the postnatal period is quite different to something like, say, Preston Garvey's death.
So I wouldn't think that execution would be appropriate, even were the death penalty available.
The death penalty seems most appropriate for cases where recidivism (murder or brutal violence) seems so likely and unavoidable that the person has a whole life order, where the person has killed multiple people, in cases where torture and sadism were involved (whether the victim was murdered in addition or 'just' assaulted/raped), and in cases involving child sex abuse where it's clear that rehabilitation isn't possible.
The safest way to avoid high numbers of MOJ would be having an even higher bar to reach for that particular sentencing – off the top of my head, things like video evidence of the person's actions, or DNA evidence plus it being confirmed no other person was present at the time, for instance.
MOJ are undesirable, of course. But as I've said, multiple people (often babies and children) are killed each year by dogs, and we still allow dog ownership, so clearly society is fine with a certain level of avoidable deaths.