Here's a restatement without all those corpses: In the event that an accident appears unavoidable, the computer should do everything within it's power to stop the car immediately. (This is already a given: safety first.)
"If there are multiple ways of doing the above, what variables should the computer optimize for - stopping distance alone, or stopping so that it doesn't immediately get rammed from behind?" There's your trolley problem again, just restated so it doesn't appear so offensive: in both cases, the occupants of the vehicle are in danger, as are the occupants of nearby vehicles. Now is the interest in the rabbit-hole clearer? The problem doesn't go away just because it's inconvenient to solve...
We tell humans not to swerve for squirrels, because it's a great way to end up dead, so the computer should get the same instruction. Slow down as you can, the prime directive is to maintain control.
In other words, there is always a balance between safety and usefulness, and the question of "is this the right choice" is always upon us, whether we want it or not. You can never have certainty anyway, what the software is doing is maximizing on some reward function. The TP also asks "is there even a moral component to this?" It seems there is, from the range of emotions this conjures up.
(btw "do not swerve to avoid unknown objects" has directly caused at least 1 dead person - Elaine Herzberg - so that's a really unfortunate maxim for illustrating your point: the car has also an obligation not to be a danger to others. "We just maintain control and everything else be damned" is easy to explain in court, true: IANAL, but sometimes you need more than a simple explanation to avoid being convicted.)
Elaine is not a great example because not only did the car choose not to swerve, it also chose not to even try to brake. And on top of that, a human would have seen her from a lot farther away.
And the larger point stands: "protect occupants, ignore outsiders" is a choice in the TP, always choosing the same strategy is not "TP is irrelevant."
Most safety problems in driving can be solved by slowing down.
The problem with AI is all those weird, little edge cases that humans can reason through -- for example: if there's a deer next to the road, then I'll slow down, even if it's not on the road yet. I've known many people who have hit a deer when it spontaneously jumps into traffic. Or something like: someone's not quite staying in their own lane, so I have to be careful when I pass them.
I doubt that this is a use-case that legal, for-profit companies will be pursuing.
For the other use-cases, you can just say: Manual driving only.
[ ] Let self driving cars kill people during development but try to make it up by saving thousands of lives after they are perfected. (Uber)
[ ] Make self driving cars extremely safe from the start but more people end up dying from manual driving because development takes longer. (Waymo)