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."