We now have caesarian sections to solve this problem in most cases. Impending death of the mother from what?
Personally, I don't think that there should be explicit exceptions, but a general one -- that is, _every_ death in a hospital already has to have an M&M conference. I think the death of an unborn child should be simply treated likewise. There are always cases (though thankfully rare) in a hospital where the doctor _has_ to decide between two lives. Who gets the O-negative? Which patient gets treated first? Etc. If a decision by a doctor causes, or might cause, the death of a patient, that case must be reviewed for a number of things, including medical error. If a patient dies unnecessarily, that could bring specific reprocussions against the doctor (both legal and professional).
I think an unborn baby should be treated just like any other patient in a doctor's care -- the mother and the child treated more-or-less like a case of conjoined twins. We don't need idiotic exceptions like "in the case of medical health to the mother", nor do we need to impose specific penalties relating to an unborn baby. To honor a child with the rights due it is to remove such exceptions and treat it as a human. In the medical field, mistakes happen, and choices have to be made. But in every case where a death is involved, those choices must be defended to a review board to make sure that EVERY patient's rights were honored. All we need to do is make sure that the baby qualifies as EVERY PATIENT, and then we don't need to bother with explicit penalties or exceptions.