In my case the problem was that I had both the Python plugin and the Jupyter plugin installed, and Jupyter was crashing. I had ignored the Jupyter crash messages, since I wasn't currently using Jupyter features. But F12 was broken and I couldn't find "Python: Select Interpreter" via ctrl + shift + p.
I disabled the Jupyter plugin, restarted, and selected the right interpreter then F12 began to work again.
Versions: