Follow some basic rules so as to avoid making the mess.
Only install standard packages from distro’s repository and Python’s pseudo-official PIP. For both, keep a text file with the installed package names. No compiling from source EVER. Too much hassle to maintain.
Back up config files that I changed. Not all of them.
Keep a text file to record what I did, with exact commands etc, whenever I need to go off-road. Much experience taught me that this is a chore that is very much worth the effort.
But still, the problem you point to is real. It’s the reason for immutable distros. The idea of which I find quite tempting.
Your point is a bit off-topic but I for one agree with you.