They've made almost 9 million cars overall, with a lot of those made in the last several years. Spreading it over the cars they've made so far, 40,000 / 9 = 4,444.44.
Doesn't seem that crazy. I'm not seeing your point.
That's 9 million (and probably many more unless Tesla disappears tomorrow) far cleaner cars on the road, offsetting what would have probably been ICE sales.
I'm no Tesla-stan but spending $40B over a decade to inject massive amounts of change in an entrenched industry to move forward in efficiency and emissions sounds like a pretty good investment to me.