Overwrite argv[1:] with argv, restore on exit.

def _custom_argv(argv):
    """Overwrite argv[1:] with argv, restore on exit."""
    backup_argv = sys.argv
    sys.argv = backup_argv[:1] + argv
    try:
        yield
    finally:
        sys.argv = backup_argv