I've just stumbled with this 'equality by value' behavior.
Even though for most cases this is just what is needed, there are some scenarios where one would like to actually compare arrays by reference instead. I haven't yet found a builtint way to do this, so I resorted to create a Wrapper script in order to wrap values that 'compare by value', so that you can compare (the wrapper) by reference instead. Here it is in case anyone needs it
extends Reference
class_name Wrapper
var value setget set_value, get_value
func set_value(v):
value=v
func get_value():
return value
func _init(v=null):
value = v