def METHOD_NAME(install_stderr, path_env=None):
    """Create new PATH variable with missing pip scripts paths added to it.
    Args:
        install_stderr (str): stderr output from pip install command.
        path_env (str): Custom PATH env value to start off with.
    Returns:
        str: New PATH variable value.
    """
    if path_env is None:
        path_env = os.getenv('PATH', '')
    paths = path_env.split(os.pathsep)
    for match in PIP_PATH_REGEX.finditer(install_stderr):
        script_path = match.group(1)
        if script_path not in paths:
            paths.append(script_path)
    return os.pathsep.join(paths)