Other mitigations are possible, such as a battery compartment designed for cells that are 69mm long, as is typical for protected cells instead of 65mm. I'll admit I complain about this when reviewing a flashlight (use longer springs so it's not picky), but it's likely the right choice for many applications.
It's not the right choice for all applications of course. Products intended for children and that are particularly demanding in terms of electrical power require greater caution than speakers or most flashlights.
> The batteries that come with the light are perfect, but all the panasonic 18650s I have purchased are about 1/8 (3mm) too short.
> I was thinking of using aluminum foil.
If people on enthusiast forums are struggling to put batteries in their devices safely, the mass market is doomed. Proper safety engineering is to design a device in a way where foreseeable misuse by a layperson does not result in a safety issue.
This isn't incompatible with a right to repair. Just simply don't glue the device shut. The LiPos used in many devices are common jelly-bean components.
I don't think it should be required that devices protect users from unsafe modifications even if they're foreseeable. I can also tape down the safety bar on the lawnmower, remove the guards from the circular saw, and take the firing pin block out of the gun. I'm sure people have done all of those things, and some have regretted it.
What I'm advocating is a bit beyond just repairability; field-replaceable batteries the ability to charge spares externally, and the ability to share spares between devices are substantial benefits.
It's not the right choice for all applications of course. Products intended for children and that are particularly demanding in terms of electrical power require greater caution than speakers or most flashlights.