docs: def setup_restart():
      """Sets up restart functionality that doesn't keep the first process alive.
         The function needs to be called before the actual process starts but
         after loading the program. It will restart the program in a child
         process and immediately returns in the child process. The call in the
         parent process never returns. Calling this function is not necessary for
         using restart functionality but avoids potential errors originating from
         rogue threads.
      """
      exit_code = os.environ.get('QUICK_SERVER_RESTART', None)
      if exit_code is None:
          try:
              atexit.unregister(_on_exit)
          except AttributeError:
              atexit._exithandlers = filter(
                  lambda exit_hnd: exit_hnd[0] != _on_exit, atexit._exithandlers)
          _start_restart_loop(None, in_atexit=False)