I tried all the suggestions from that short-lived AI answer and the only thing that ended up working for me was installing Python 3.11 using MacPorts, setting up a Venv and reinstalling all dependencies, now the code works like a charm again.
Wish I knew why my old installation broke when I didn't change any of the code files, but I suspect it has something to do with the packages I installed yesterday when toying around with Flask.
Taught me to use a Venv for different projects.