Fixing pasting code from PyCharm to the Nuke Script Editor

For a few years now, I have not been able to copy code from PyCharm and some other sources and then paste them into the Nuke script editor. Somehow, when pasting code from PyCharm into the script editor, absolutely nothing happens. The annoying workaround is to copy from PyCharm, paste in a simpler text editor [...]