It seems somewhat superfluous to use multiple optional arguments, since their optionality switches to being mandatory once you need to use more. Unless, of course, you change the syntax.
The LaTeX3 interface to macros using \NewDocumentCommand allows for easily negotiating (multiple) optional arguments using o for [] arguments (or d<token><token> for a specific <token><token> pair). Testing is done using \IfValueTF{<arg>}{<true>}{<false>} (or more simply if nothing needs to be done when nothing is supplied, \IfValueT{<arg>}{<true>}).

\documentclass{article}
% \mycommandA uses the default [] for optional arguments
\NewDocumentCommand{\mycommandA}{ o o o }{%
\mathrm{H}
\IfValueT{#1}{(#1)
\IfValueT{#2}{(#2)
\IfValueT{#3}{(#3)}}}
}
% \mycommandB uses () for optional arguments
\NewDocumentCommand{\mycommandB}{ d() d() d() }{%
\mathrm{H}
\IfValueT{#1}{(#1)
\IfValueT{#2}{(#2)
\IfValueT{#3}{(#3)}}}
}
\begin{document}
$\mycommandA[a]$
$\mycommandA[a][b]$
$\mycommandA[a][b][c]$
$\mycommandB(a)$
$\mycommandB(a)(b)$
$\mycommandB(a)(b)(c)$
\end{document}
\foo,\foo[1],\foo[1][2],\foo[1][2][3]so you need a test if the option used, or three mandatory, but possibly empty arguments\foo{1}{2}{}? – David Carlisle Mar 08 '23 at 22:31