I can only repeat again that you should use as few as possible variants.
I can only repeat again that I agree with you in general. However for split screen and other forthcoming foldable devices an app can find itself in quite a wide variety of sizes and aspect ratios and will have to adapt itself to a wide range of available display areas. While I haven't fully analysed the above code I think, in practice, in any one layout on any single device only one portrait and one landscape variant can ever be chosen. I'd like to be wrong!
As you can probably tell from my recent posts I have been adapting my flagship mapping program app to work in split screen which, owing to the density of controls in normal portrait and landscape modes, requires only a differently laid out subset of the normal views to be available in order to be usable. As the present layout variant detection will never be able to load a split screen variant the only alternative is to programmatically detect whether split screen mode is in use and load an entirely different layout. I foresee a similar problem when a foldable is used when the effective device size will double when an app is stretched across the entire display area and may want to take advantage of the extra space.
I guess that in theory a designer script should be able to detect that it is a split screen size and aspect ratio and adjust things accordingly. I haven't considered this up to now so I shall have a play at doing this.
As an aside split screen in Android 10, where both apps can be active at the same time, is impressively useful on a large screen device! I have had two mapping apps, mine and AlpineQuest displaying simultaneously, both GPS tracking and moving the maps, one a 50K overview and the other a detailed 10K street level view. It is less impressive on earlier devices where only one of the apps can be active.