Meson warns about a broken Python install on Debian/Ubuntu

Peter Maydell mentions an issue on Debian/Ubuntu where the Meson script believes the Python installation to be broken:

WARNING: Broken python installation detected. Python files installed by Meson might not be found by python interpreter.

Can this message be fixed or otherwise solved?