A function cannot affect its caller's positional parameters. This is by design: positional parameters are meant to be private to the function.

Make your function work on an array.

    myfunction () {
      local _myfunction_arrayname=$1
      shift
      … # work on the positional parameters
      eval "$_myfunction_arrayname=(\"\$@\")"
    }
    myfunction foo "$@"
    set -- "${foo[@]}"