New helper function `is_scalar` to determine whether an expression is scalar, functions define whether they return/require scalar values or not
Check functions for correct use with regards to scalar arguments during code generation