My question is closely related to a previous question on dealing with special characters in arguments. However, I was not able to adapt the technique described there to my needs.
The MWE
\documentclass[fontsize=11pt, paper=a4, DIV=9]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb}
\usepackage{relsize}
\usepackage{xparse}
\makeatletter
\newcommand{\IT@Def@Hash}{\begingroup\catcode`\#=12 \gdef\IT@Char@Hash{#}\endgroup}
\newcommand{\IT@Def@Tilde}{\begingroup\catcode`\~=12 \gdef\IT@Char@Tilde{~}\endgroup}
\NewDocumentCommand{\Char}{>{\TrimSpaces}m}%
{%
\def\IT@Char{#1}
\ifx\IT@Char\empty
\mbox{$\varepsilon$}%
\else
\IT@Def@Hash
\ifx\IT@Char\IT@Char@Hash
\mbox{\texttt{\#}}%
\else
\IT@Def@Tilde
\ifx\IT@Char\IT@Char@Tilde
\mbox{\textscale{.87}{$\Box$}}%
\else
\mbox{\texttt{\IT@Char}}%
\fi
\fi
\fi
}
\makeatother
\begin{document}
\Char{}
\Char{~}
\Char{#}
\Char{x}
\end{document}
produces exactly the output
I am looking for. Unfortunately, LaTeX issues five errors.
It would be quite convenient to "misuse" the special characters ~ and # in the argument of \Char{}. On the other hand, it is not really necessary, and I would avoid it if it causes too much trouble.

\catcode\#=12is not having any effect as#` has already been tokenized with its standard catcode. – David Carlisle Nov 12 '17 at 18:29