I've had the same issue (10 seconds to change a pin from input to output...) with my W10 x64 system and the solution was to uninstall the java runtime on my system. I think STM32CubeIde has its own java machine and in my case my java runtime was used...