docs: def _terminate(self, level: int) -> bool:
          """
          Returns: succeeded in *attempting* a kill?
          """
          if not self.running:
              return True
  
          # Already closed by itself?
          try:
              self.wait(0)
              return True
          except subprocess.TimeoutExpired:  # failed to close
              pass
  
          # SEE NOTES ABOVE. This is tricky under Windows.
  
          suffix = " [to child process {}]".format(self.process.pid)
          if level == self.KILL_LEVEL_CTRL_C_OR_SOFT_KILL:
              if WINDOWS:
                  success = 0 != ctypes.windll.kernel32.GenerateConsoleCtrlEvent(
                      CTRL_C_EVENT, self.process.pid)
                  if success:
                      self.info("Sent CTRL-C to request stop" + suffix)
                      # ... but that doesn't mean it'll stop...
                  else:
                      self.info("Failed to send CTRL-C" + suffix)
                  return success
              else:
                  self.warning("Asking process to stop (SIGTERM)" + suffix)
                  self.process.terminate()  # soft kill under POSIX
                  return True
  
          elif level == self.KILL_LEVEL_CTRL_BREAK:
              if not WINDOWS:
                  return False
              success = 0 != ctypes.windll.kernel32.GenerateConsoleCtrlEvent(
                  CTRL_BREAK_EVENT, self.process.pid)
              if success:
                  self.info("Sent CTRL-BREAK to request stop" + suffix)
              else:
                  self.info("Failed to send CTRL-BREAK" + suffix)
              return success
  
          elif level == self.KILL_LEVEL_TASKKILL:
              if not WINDOWS:
                  return False
              retcode = self._taskkill(force=False)  # does its own info messages
              return retcode == winerror.ERROR_SUCCESS
  
          elif level == self.KILL_LEVEL_TASKKILL_FORCE:
              if not WINDOWS:
                  return False
              retcode = self._taskkill(force=True)  # does its own info messages
              return retcode == winerror.ERROR_SUCCESS
  
          elif level == self.KILL_LEVEL_HARD_KILL:
              # Last resort
              self._kill()  # may do TASKKILL /F or some other method
              return True
  
          else:
              raise ValueError("Bad kill level requested")