def METHOD_NAME(
    request: Request,
    base_url: str = None,
    path: str = None,
    headers: Union[Headers, Mapping[str, str]] = None,
) -> Request:
    """
    Creates a new request from the given one that can be used to perform a proxy call.
    :param request: the original request
    :param base_url: the url to forward the request to (e.g., http://localhost:8080)
    :param path: the path to forward the request to (e.g., /foobar), if set to None, the original path will be used
    :param headers: optional headers to overwrite
    :return: a new request with slightly modified underlying environment but the same data stream
    """
    # ensure that the headers in the env are set on the environment
    # FIXME: we should preserve header casing like we do with the `asgi.headers` property in the  asgi/wsgi bridge to
    #  pass through the raw headers.
    set_environment_headers(request.environ, request.headers)
    builder = EnvironBuilder.from_environ(request.environ)
    if base_url:
        builder.base_url = base_url
        builder.headers["Host"] = builder.host
    if path is not None:
        builder.path = path
    if headers:
        builder.headers.update(headers)
    # FIXME: unfortunately, EnvironBuilder expects the input stream to be seekable, but we don't have that when using
    #  the asgi/wsgi bridge. we need a better way of dealing with IO!
    data = restore_payload(request)
    builder.input_stream = BytesIO(data)
    builder.content_length = len(data)
    # Since the payload is completely restored, the proxy forwarding is not streamed.
    # Therefore, we need to remove a potential "chunked" Transfer-Encoding
    if builder.headers.get("Transfer-Encoding", None) == "chunked":
        builder.headers.pop("Transfer-Encoding")
    new_request = builder.get_request()
    # explicitly set the path in the environment and in the newly created request
    if path is not None:
        new_request.environ["RAW_URI"] = path or "/"
    # copy headers s.t. they are no longer immutable (by default, EnvironHeaders are used)
    new_request.headers = Headers(new_request.headers)
    return new_request