Use functools cache instead of open-coded implementation
Use functools cache instead of open-coded implementation

Functional behaviour is not identical, because the cache not set
when an exception is thrown. I hope this doesn't matter in practice.

mesonbuild/meson,pexip/meson,jpakkane/meson,pexip/meson,jpakkane/meson,pexip/meson,jpakkane/meson,becm/meson,becm/meson,jpakkane/meson,mesonbuild/meson,jpakkane/meson,mesonbuild/meson,becm/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,becm/meson,mesonbuild/meson,becm/meson,mesonbuild/meson,becm/meson,QuLogic/meson,pexip/meson,becm/meson,QuLogic/meson,QuLogic/meson,jpakkane/meson,QuLogic/meson,jpakkane/meson,jpakkane/meson,QuLogic/meson,pexip/meson,mesonbuild/meson,mesonbuild/meson,pexip/meson,becm/meson,QuLogic/meson,pexip/meson,jpakkane/meson,pexip/meson,becm/meson,QuLogic/meson,mesonbuild/meson,pexip/meson,QuLogic/meson,becm/meson,QuLogic/meson