How to run scripts in the background of the game engine without freezing or opening new Blender instances on Windows?
The threading module should take care of it. Just create a separate python thread and run your blocking code (e.g. networking code) in there.

import time
import threading

def main():
    thread = Worker(None)
    thread.start()

class Worker(threading.Thread):

    def __init__(self, args):
        self.args = args
        threading.Thread.__init__(self)

    def run(self):
        print("Starting worker")
        ...
        print("Finishing worker")


Note that Python 3's threading model does not map to the OS threads, all the threads will run under the Python interpreter anyway. Because of this, threading is only useful for executing blocking operations, not for performance gain.