This forces the process holding the editor to be closed with seemingly no way to handle it from the Python side:
X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 15 (X_QueryTree)
Resource id in failed request: 0x134cb16
Serial number of failed request: 333
Current serial number in output stream: 333
I'm not sure if it happens when opening the window or when closing it or both.
Additionally, the editor window cannot be resized or moved properly on Windows systems as it is borderless for some reasons.