That depends on what exactly you mean by scalar.
Do you mean a function that's just a number? Then of course you can think up any function you want that turns three input numbers $x, y$ and $z$ into one output number $U(\vec{r}) = U(x,y,z)$. Examples would be $U(\vec{r}) = |\vec{r}| = \sqrt{x^2 + y^2 + z^2}$ or $U(\vec{r}) = x + y - 2z$, or just general definitions such as $U(\vec{r}) = $ temperature at location $\vec{r}$, or $\varrho(\vec{r}) = $ Charge density at location $\vec{r}$.
If, however, by scalar you mean an object that's not only a number, but also rotationally invariant, then your options are a tiny bit limited. An object that's invariant under rotation cannot depend on the specific direction of $\vec{r}$ but only on its magnitude, so the first example above would be a scalar, but the second example would not.
EDIT: Since this was migrated from the physics SE, let me note that there are some subtle differences in nomenclature. In physics, the term "scalar" can have more meaning than "element of $\mathbb{R}$ or $\mathbb{C}$. It can mean: "Something that is invariant under rotation". Or, in the case of a Lorentz scalar, "something that is invariant under a certain transformation".