docs: def get_default_shell(environ=None, fallback=_UNSPECIFIED):
      """Get the user's default shell program."""
      if environ is None:
          environ = os.environ
      # If the option is specified in the environment, respect it.
      if "PIAS_OPT_SHELL" in environ:
          return environ["PIAS_OPT_SHELL"]
      # Find all candiate shell programs.
      shells = []
      for filename in (environ.get("SHELL"), "bash", "sh"):
          if filename is not None:
              filepath = find_executable(filename, environ)
              if filepath is not None:
                  shells.append(filepath)
      # If one of them is an ancestor process, use that.
      for ancestor in get_ancestor_processes():
          if ancestor in shells:
              return ancestor
      # Otherwise use the first option that we found.
      for shell in shells:
          return shell
      # Use an explicit fallback option if given.
      if fallback is not _UNSPECIFIED:
          return fallback
      raise ValueError("Could not find a shell")