The car will turn off eventually even if not locked, however, every time you access it (to get the aforementioned sunglasses etc) it will wake up. The “I refuse to lock my car in the garage” thing people say really confuses me, but I get that some people are like that. Enough are like that, that tesla puts an option in the car now to not lock it when its at home.
Of course, then you have to depend on the car to know whether its IN the garage, or in front of the garage. I have no idea if it locks in front of the garage but not IN the garage, but I doubt its that accurate.
If your car is running all night, its likely you have something else keeping it awake (like some third party monitoring app that you have not setup
correctly. That is the primary cause of “My car wont sleep”, and “I tried XXX third party app but deleted it” does not remove its access to your car. If you EVER (even once) logged into your car using any third party app, including but not limited to Teslafi, Teslamate, Watch for Tesla, Stats, Abetterrouteplanner, or ANY other service that said “log in here with your tesla account to track / account for, etc this information on your tesla” change your tesla account password and see if your car will sleep.
Also, as stated, there is a “power off” button in the car menus but the car turns on when you open any door, and I doubt there will ever (ever) be a situation where the car does not turn on when you open a door or otherwise access it with the tesla app.