Would better location tracking for airliners improve safety? Once in a while an airliner just up and disappears -- typically over ocean -- and lengthy and expensive search efforts have to be launched in order to find it. The most famous cases in recent years were of course AF447 and MH370.

It is hard for the bemused public to understand how something as large and technologically advanced as a wide-body jet can just go missing. Some people end up on websites like this one, asking why we can't just do such-and-such to make sure planes can always be found. The answers typically center around how such-and-such would actually be very expensive, and probably not 100% effective anyway. This doesn't really seem to convince most questioners, who wonder how important a bit of cash ought to be when there are lives at stake.

The purpose of this question is to clarify whether lives are actually at stake.

Suppose we had a magical technology which at negligible cost could give us reliable access to the exact flight path of an airliner in trouble anywhere on Earth. How much safer would that make flying?

For definiteness, let's assume that the magical technology gives us position samples at 1-minute intervals at a one-hour delay, so it won't be useful for real-time purposes such as ATC.
Would better location tracking for airliners improve safety?

Very simply, no.... us knowing where AF447 was would have made exactly zero difference to the fact that it crashed into the ocean at 400+ knots.

Would we have had a better idea of where to find it? Most probably. Would it have saved any lives? Absolutely not.

As always, these things come down to cost-benefit, and the simple fact is that GPS tracking would prevent very, very few accidents. The only possible benefit would be that it may help us find the black box or wreckage, assisting in the investigation which may just possibly reduce the chances of a similar accident occuring in future. Note that of the two examples you gave, though, only MH370's black box hasn't been found (yet)... so even this benefit is tentative.