It’s not that simple… the voltages are all different, and each chemistry has different charge and discharge rates, so this just makes the end product insanely complicated and expensive.
We've already got programmable charging chips that can adapt to different chemistries, and they're already pretty cheap, and USB-C has proven that fancy voltage negotiation protocols can be done cheaply.