In order to avoid losing information, it sometimes makes sense for the
output attribute type to depend on the types of the input attributes.
A function for this already exists, attribute_data_type_highest_complexity,
it just needs to be used in more places. The change for the attribute compare
node is just so the code there uses the same code style as in the attribute
mix node.
Ref T83793