See feature request: possibility to disable auto update for certain extensions · Issue #30579 · microsoft/vscode · GitHub and possibly Visual Studio Code Frequently Asked Questions on how to deactivate PIO extension updates in VSCode (to be safe you should also a pre-version-5 core extension such as 1.10.0.
In order to revert the PIO core itself, tell PIO in the extension settings to not use the builtin PIO core (aka use the global one), then use the python pip
program to install PIO core 4 as listed in Marlin: Help me ERRROR ModuleNotFoundError - #11 by maxgerhardt.
I’m not sure if it’s possible to downgrade the PIO version for the builtin PIO core module, but if you want that, I guess you can try telling it the bundled pip
which should be somewhere C:\Users\<user>\.platformio\penv\Scripts\pip.exe
.