It can be quite a rabbit hole. I'm pretty non-scientific.
If I had a bike that I'd ridden for 20 years pain free, especially knees, I duplicate the saddle position on the new bike. Personally I use the back of the saddle and the BB with a level at 90 degrees. I will double check back of the saddle to pedal at furthest point of rotation.
Then it is just about measuring to the center of the handlebar tops. That basically gets you to the difference to make up in part or whole.
I would think that there is a range of stem lengths, where the change is hardly, or not even, perceptible to most people, but can be used to get you in a comfortable position.
The stem length/bar width can be baffling sometimes, and I tend to think weight distribution might be a bigger factor. I put a flat bar on a road bike that was always a little sluggish and now it zips around. In theory going from 40cm to a 60cm bar would slow things down. I ride more more upright on that bike. And handlebars don't turn that much to corner.
John