I was concerned about this when I needed to change out the battery in my 2015 Jeep Grand Cherokee a couple of months back. I went on the Jeep forums, and they were all talking about using these plug in "memory savers", so the car wouldn't throw codes, and "forget" everything.
Along with how if you don't, the car will run like crap until the computer "remembers" everything all over again, which can take several hours of driving, etc. etc. I almost had the dealer replace the battery, because I was so worried about it.
Then I came across this article, and it made sense to me. So I pulled the battery out, drove to Autozone, got the best AGM they sold that matched it. Came home and installed it.
The battery was out of the vehicle for a good 2 hours total. From the time I disconnected it, to when I came home and got around to installing the new one, and hooked up the terminals.
www.vehicleservicepros.com
It was totally uneventful. As it turned out, I was worried about nothing. The car immediately started and ran beautifully. Smooth idle, perfectly smooth shifting, along with good throttle response. Absolutely nothing out of the ordinary.
Not only that, but all the radio stations, phone pairings for both my wife's phone and mine, along with power seat and rear view mirror settings were all there. In short the car "remembered" everything.
So while a few things might happen on some makes and models, in general, like so many things, this kind of stuff tends to get over blown. When My 2018 Toyota needs a new battery, I'm going to do the same as I've done on every car I ever owned. Replace it and not worry about it.