A short answer to your question is: Yes, although depends on the definition of functions/values but read on.
I shall refer to constants or rather quantities which do not change as scalars for now.
Scalars are quantities that are fixed. Suppose a vector which is a list of numbers or a line originating from the origin that has magnitude and direction. Now, let $\mathbb{\mathcal{v}}$ be a vector with elements $(2,3)$, then what is $3\mathbb{\mathcal{v}}$?
Note that $\mathbb{\mathcal{v}}$ is just an arrow/line segment from origin towards $(2,3)$, and $3.\mathbb{\mathcal{v}}$ is nothing but an extension of this line segment to $3.(2,3)=(6,9)$, so basically $\mathbb{\mathcal{v}}$ is "scaled" three times to become $3\mathbb{\mathcal{v}}$. Hence, the number $3$ is called a scalar, because it scales.
Now in case of just the real number line, think of $\mathbb{\mathcal{v}}$ as $(\mathcal{\hat{i}},0)$ then, $3$ is nothing but $3.(1,0)$, which is scaling the unit vector thrice in the direction of positive $x$. Hence, $3$ is a scalar. Similarly, it can be said for any real number.
A key property of these scalars is that they do not undergo any transformation in any arithmetic operation, that is their value is fixed. For instance $-1.(2,0)$ scaled the vector twice in negative $x$ direction but no change to the value $-1$ occurred. It remained constant under linear transformation. And this holds for any other transformation involving scalars. Hence, the name "constant".
Now coming to your question, "Can a function be a constant?"
What are functions? They are not "values" but just maps. A function $f(x)$ can be constant if no matter what the value of $x$ is, the value of $f(x)$ remains same. So, a function like $f(x)=4, \; \forall x \in \mathbb{R}$ is a constant function.
So, if I denote $f(x)$ by $y$, then I can say that in $y=4$, y is a constant and this in a very vague sense is a constant equation but it is better to avoid this terminology.