Modern laptops shouldn't be drawing their power from the battery when plugged in though, and they should stop charging the battery once fully charged. The only potential issue is that they typically keep the battery charged to 100%, while keeping a lithium battery closer to two-thirds charge tends to be a lot better for its long-term health. All they really need is a software option to keep the battery at a reduced charge level when plugged in for extended durations, togglable to a "full charge" setting for when optimal runtime away from a power source is needed.
...
But even with a physical switch, the heat from the laptop could still degrade the battery at an increased rate over time. The best physical option would simply be a battery pack that's removeable and easily replaceable, something that was the norm on most laptops until falling out of favor in recent years as devices became thinner and lighter. Manufacturer's don't really gain much out of making a device last for an extended number of years though, when a failing battery will just make people more likely to buy a new device from them.