No no no, don’t add those paths to PATH systemwide. Actually, there should be a shortcut called x64 Native Tools Command Prompt for VS 2019 if you use “Windows Search”. Opening that window, all the VS related environmental variables will be properly set.

As far as I understood, CUDA wants a “real” Visual Studio version, e.g. Community, but the install instructions clearly suggest the BuildTools. Any idea on how to solve this?

It doesn’t care if you have build tools or community. Nvcc would be happy if you have MSVC toolchain installed.
As for your problem in building the library, it looks pretty similar to Cannot build PyTorch with Python 3.9 on Windows · Issue #47460 · pytorch/pytorch (github.com) 3 and is resolved by Fix python 3.9 builds on Windows by peterjc123 · Pull Request #47602 · pytorch/pytorch (github.com) 3.