$40 is per fill up I'm assuming. What's your total gas price for the month? There are a couple calculators online that you plug in monthly miles driven, your per gallon price, your per Kwh price at your house and figures out how much you'll save. Add in the cost of the Tesla to see how much a month you'll really spend.
For me, my story is in late 21 I was looking at a newer vehicle. I drive 2k miles a month and was spending about $750/mo to fill my paid off '08 diesel Jeep. Plugging my numbers into the calculator, I was projected to save about $700/mo. In my head, I could buy a M3P for essentially $200 a month. It was a $900/mo payment, so I did. I was able to get a 1.99% rate.
Energy price was pretty close, I think I'm at $60 month vs the $50 projected. Insurance amount wasn't a factor cause it was about the same as the other cars I was looking at.
Then there's the other costs like installing a 60w breaker and Tesla wall connector. Though I can easily justify that cost as future proofing the house.
I also didn't look at the purchase as strictly a financial move. Otherwise I'd buy a Corolla and drive it for the rest of my now, miserable life.