Swapping out is possible only if there are shared libraries though.
For statically linked programs is there anything that can be done?
Valve does a lot of hacks in Proton to make particular games run better. I think swapping a static library might also be possible if you target a particular game.