Yes I agree on 100% that it's unnecessary to pass handles by &in reference.
But such signature is a part of ScriptArray addon API: when we create a variable of
type array<IItem@> the find method
(whose signature is int find(const T&in if_handle_then_const value) const)
will actually have the find(const IItem@ &in if_handle_then_const value) const signature.
It seems there is no any method to avoid such a situation in array<>.
To my information, that is incorrect. If you attempt to query the signature of the method, it's actually "int array::find(Item@const&in value) const" (or likely "int array::find(const Item@const&in value) const" in the WIP version I am not using). Notice the const qualifier in front of "&in", meaning that the handle should be passed by const &in reference rather than just &in, and thus it's possible to avoid creating a copy of the handle. The same signature would not be considered valid in other contexts, i.e. outside of templates. As such, outside of templates it is unnecessary and actually somewhat inefficient to use the signature you're using.