You can edit “mingw64.ini” or “msys2.ini” or "UCRT64.ini" in the MSys2 install directory. Uncomment the line that reads:
MSYS2_PATH_TYPE=inherit
It should let Msys2 see paths for the Windows Python or any other Windows tools or libraries.