Ohh, now I finally get what you mean - the difference between “by val” and “by ref”. But that’s how it works in most programming languages, it’s not only GDScript thing - most primitive variable types are passed by value, not reference.
I would suggest that maybe you could make a custom inner class and put an int variable inside. Classes are passed by reference. I would say this solution would be more elegant than using Arrays.