I use the paid version of an app called Al Dente [1] to set the battery charging level to a specific limit. The app has a free mode. It has more features than what I stated, and works on Intel Macs and Apple Silicon Macs (limited only by what the underlying hardware allows).