I have penciled it out and if you drive more than 15,000 miles a year, then the Tesla Model 3 should be the current cheapest car on the planet, beating out the Prius and beating out other electric cars. When you look at the Tesla Model 3 basically there is the running costs of charging, rotating and changing the tires, and a few small maintenance things. Then the car goes 300,000 - 500,000 miles before you need to swap the battery at which point most people dump their EV overboard. If you do pay for the battery replacement, the drive train should go for 1,000,000 miles or more, especially if you are doing 30,000 miles or more a year. The Tesla Model 3 also has an excellent safety record for multiple reasons, so something to factor into TCO is average money spent on accident related medical bills, loss of productivity due to injures when driving a non Tesla, and potential loss of life. Then I think the Tesla has a good resale value.
The Prius is the best of the primarily petrol cars because its fuel economy is pretty good, the hybrid system makes the car very low maintenance (I have a Prius and love this aspect of the car), and it is a car that can go hundreds of thousands of miles before it is really worn out. At this the battery can make it 200,000 to 300,000 miles from what I have read. At this my battery is getting pretty up there on the miles and is still kicking strong. The Prius also has a really good resale value, which makes a difference in its TCO factoring.
Most every pure petrol car out there chugs down expensive gas, which adds up over time, especially as it gets more expensive, needs lots of regular planned maintenance, and has lots of unplanned maintenance due to the mechanically complex drive train breaking down. While I have seen a petrol car go over 500,000 miles due to a really good mechanic owning and maintaining the car, really they tend to go 150,000 to 200,000 before it is just not worth keeping them going anymore, so then it is time to plunk down the money for a new one. My last petrol car passed the $400/mo in unplanned maintenance around the 140,000 mile mark and then needed thousands of $ of more unplanned maintenance all at once just passed the 150,000 mark, most of the work I did myself so I could get the car ready to sell off and then got rid of it wondering why I bothered because it still sold for a really low amount, barely worth more running than scrap metal due to how Kelly Blue Book rated its value in a running state.
So yeah a petrol car will give you a lower up front cost, but if you do a significant amount of driving, really a petrol car make no sense over electric or even hybrid electric today. The equation for electric cars only gets better over time. While I am not providing numbers above, I have done some comparisons. For example by the 200,000 mile mark the calc I had for the Tesla Model 3 over a similar petrol car was over $25,000 less in total costs. By the 300,000 mark, which the Tesla Model 3 should make it fine, it should be more like $60,000 in savings as the original Model 3 is still going while with pure petrol it is a different car with anywhere from 100,000 to 150,000 miles on it because it just wasn't worth trying to keep the original petrol only car going.