When a command runs the wrong version of a tool, the first question is which file Windows actually starts. where answers that, with one catch in PowerShell. I’d start with it whenever a tool behaves like a different version.
In Command Prompt:
where python
where /r C:\Users\<user> notes.txt
By default where searches the current directory and every folder in your PATH, and it lists all matches in the order Windows would find them. The first line is the one that runs. If you leave off the file extension, it tries the ones in the PATHEXT variable, such as .exe and .bat.
A few options:
where /r C:\ test # search recursively from a folder
where /q git # no output, only exit code 0 or 1
where /t node # show size and modified date
where $public:*.* # search folders listed in an environment variable
The catch: in PowerShell, where is an alias for Where-Object, so typing where python there does not do what you expect. Type the full name with the extension, where.exe python, or use the PowerShell cmdlet Get-Command python.
Other caveats: it matches files by name, so it tells you nothing about aliases or functions defined in your shell. A recursive search over a whole drive can take a while. The patterns accept * and ? wildcards, and /r should not be combined with the $ENV: or Path: pattern forms.
The exit code (0 for found, 1 for not found) makes it usable in batch scripts, to check that a tool is installed before running it.
Further reading: Microsoft Learn: where