I don’t think the OP needs to track kWh consumed for tracking expenses. They mentioned tracking mileage and taking the standard mileage deduction or reimbursement from their employer.
As mentioned, no built-in recording of mileage for trips. There is teslafi, but I don’t like the idea of giving a 3rd party access to my car, so I don’t do that. While an API key doesn’t share your password, it does provide full access since Tesla doesn’t have ACLs on their API.
For me, I have one trip meter labeled Roadtrip! and reset that at the beginning of the month or a road trip where I want to track mileage. The 2nd trip meter is marked Monthly and I reset it at the end of each month to log vehicle expenses into a custom spreadsheet to track expenses (along with tracking $ and kWh used for charging at home and at Superchargers.
you either do it manually or look at one of the 3rd party tools that does data logging.