I'm not sure but i think i heard there was a solution for some rooted phones to stop charging at a specific battery level (magisk Module maybe?). Similar to al dente on a mac.
Maybe you could look into that
The best way to prevent swelling is stop charging at 80% or less (some phones have this feature, or you can use homeassistant with a smart plug), and keep the phone cool below 21C/70F.
Well, you can't prevent that entirely, it's a chemistry thing.
But you can change how android connects, and/or use a cable that doesn't charge but only does data. You used to be able to find such cables anyway, I haven't looked in a while. I'm fairly sure that you could modify a cable if you're already capable of app testing.
You could try the OnePlus 12R. The marketing claims 80% peak capacity after 4 years. But, I would instead buy a smart plug which only turns on for two hours every 12 or 24 hours. That way you only do one possible charge every day. Plus, use any limit battery charge function present on the phone(samsung, OnePlus, realme, vivo, etc)