I would like to adapt this answer of another post for one optional argument but my MWE is just a M(not)WE.
\documentclass{article}
\usepackage{xparse}
\newcommand\test[2]{#1+#2\par}
\ExplSyntaxOn
\NewDocumentCommand\testcomas{O{x}m}{
\clist_map_inline:nn { #2 } { \test{#1}{##2} }
}
\ExplSyntaxOff
\begin{document}
\testcomas{a, b ,c d, ,e }
\testcomas[T]{a, b ,c d, ,e }
\end{document}
\test{#1}{##1}instead of\test{#1}{##2}. TeX's parameters are always numbered consecutively. The double hash means that your argument is nested by one additional level. (The documentation says that in\clist_map_inline:Nn <comma list> {<inline function>}<inline function>should be code that receives the item as#1, since you are in a function definition with parameters already, you need two#s to refer to this item.) – moewe Jul 16 '20 at 16:16