1679
It's official: Smartphones will need to have replaceable batteries by 2027
(www.androidauthority.com)
This is a most excellent place for technology news and articles.
But you can put up a firmware barrier that keeps the phone from booting up, or at least from operating at full advertised capacity, unless it's an "authentic" battery that's been officially registered to that particular phone's serial number, which can only be done via special tools and software that are only available to official Apple repair shops. They've done it with cameras and screens and buttons, why not batteries? It's just another part.
At that point there's no way they can argue that the battery is user-serviceable without extra tools. Sure, they could argue that the law doesn't specify that they can't sabotage the device if you swap your battery but European courts have traditionally taken a dim view of that kind of tomfoolery.
I'm pretty sure that Apple aren't going to risk having to suddenly take all of their devices off the shelves. It's cheaper to comply.