This question is related with this question and this other question, whose answers, however, I find unsatisfactory at the present moment.
My definition of "variety of algebras" comes from MacLane, Categories for the Working Mathematician. The type $\langle \Omega, E \rangle$ of a variety of algebras is given by a graded set $\Omega$ of operators and a set $E$ of identities.
The grade of an operator is its arity. Given certain operators, one can form "derived" operators:
- if $\omega$ is an operator of arity $n$ and $\lambda_1,\ldots,\lambda_n$ are $n$ operators of arities $m_1,\ldots,m_n$, then $\omega(\lambda_1,\ldots,\lambda_m)$ is an operator of arity $m_1 + \cdots + m_n$
- if $\omega$ is an operator of arity $n$ and $f:\{1,\ldots,n\} \to \{1,\ldots,m\}$ is any function, we can form a derived operator $\theta$ of arity $m$ by setting (in terms of variables) $\theta(x_1,\ldots,x_m) := \omega(x_{f(1)},\ldots,x_{f(n)})$
An identity is an ordered pair $\langle \lambda,\mu\rangle$ where $\lambda$ and $\mu$ are derived operators of the same arity.
In every reference in the literature that I have found (and whose definitions of varieties of algebras are essentially the same as the one above), groups are the first/second example of a variety of algebras. In particular, as far as I understood, groups are considered varieties of algebras of the following type: $$\Omega = \left\{e,\iota,\mu\right\} \qquad \text{and} \qquad E=\Big\{\langle\mu(\mu,id),\mu(id,\mu)\rangle,\ \langle\mu(e,id),id\rangle,\ \langle \mu(id,e),id\rangle,\ldots\Big\}$$ where $\mu$ (the compositon law) has arity $2$, $\iota$ (the inverse function) has arity $1$ and $e$ (the neutral element) has arity $0$ (the $1$-ary identity operator $id$ seems to be always included by default). The missing pair of relations in $E$ are those corresponding to the property of "being an inverse", which in terms of variables look like $\mu(x_1^{\phantom{1}},x_1^{-1}) = e = \mu(x_1^{-1},x_1^{\phantom{1}})$. Despite missing the diagonal operator, one can still mimic a $1$-ary operator, as the external ones in the latter equality, by considering the surjective function $f : \{1,2\} \to \{1\}$ and by setting $$\theta(x_1) = \mu(x_{f(1)},\iota(x_{f(2)})).$$ However, I see no way to convert the latter into a $0$-ary operator without adding a whole family of $0$-ary operators (one for each variable $x$), which I don't like because it does not fit with the usual definitions of variety of groups. In addition, I don't like to consider $e$ as a non-defined-ary operator, so that it can be an operator of any arity ($1$, in particular), for the same reason. Finally, I see how to deal with the "group question" in categorical terms, but I would like to understand how this is handled in Universal Algebra.
Is there another explanation/solution/alternative for this issue that I don't see?
Instead of converting $\theta$ into a $0$-ary operator, you can convert $e$ into a $1$-ary operator. Explicitly, consider the unique map $f:\emptyset\to\{1\}$. Since $e$ is an operator of arity $0$, you can "relabel" its inputs via $f$ to get a derived operator $e_1$ of arity $1$. The identity you want is then $\langle\theta,e_1\rangle$ (and the corresponding identity for multiplying in the opposite order).
Intuitively, what's going on here is that the identity $\mu(x_1,x_1^{-1})=e$ is an identity of operators of one variable, where the variable just happens to not appear on the right side. But since it's an identity we want to be true for all values of $x_1$, we definitely want to consider both sides as functions of $x_1$. Taking the constant $e$ and considering it as a constant function of one variable is exactly what relabelling its inputs by the map $f:\emptyset\to\{1\}$ does.