Why is intarray's push `+` so much faster than array-to-element concatenation `||`?
It seems as if || is doing a lot more for multidimensional arrays.

For instance with || catching the following case

SELECT ARRAY[ARRAY[1]] || 5;
ERROR:  argument must be empty or one-dimensional array


Whereas, with + the array is flattened..

SELECT ARRAY[ARRAY[1]] + 5;
 ?column? 
----------
 {1,5}
(1 row)


In addition it seems intarray does not handle nulls.

SELECT ARRAY[null]::int[] + 5;
ERROR:  array must not contain nulls


It also seems || uses PG_RETURN_DATUM instead of passing by reference which seems to be what + uses with PG_RETURN_POINTER.