Tesla cars are not the only modern car that have no mechanical linkage to the door. Even if you had a keyhole, that is connected to a electrical device to unlock the door and will not work if the battery dies. I learned that from Scotty Kilmer on Youtube.
Tesla could with a software patch have the computer monitor the 12V voltage and if below 10.2V turn on the DC to DC converter from the giant battery pack and send just
Enough amps to keep the access circuitry power up. That is all programmable in software have the computer go to low power sleep mode with only the access radio on and the locks powered cut every other relay off. A 50kwh model 3 pack would last for a month if it only had to supply 4 amps at 12V set a low point on the main pack of 10% to give up on the DC to DC converter link so as to save 40 miles or so of range to get to a charge point in a double emergency. This software flash could be sent via the OTA link every Tesla has. Why it’s not already programmed to do this is a better question.