I think you’re underestimating or discounting the work the MSYS2 team put into their layered environments mechanism:
https://www.msys2.org/docs/environments/