Building on the same theme of the ConTeXt solution that I posted for your previous question, you can use \doquadruplegroupempty
from ConTeXt:
\unexpanded\def\ByTwo
{\doquadruplegroupempty\doByTwo}
\def\doByTwo#1#2%
{{\bf #1} ‘#2’
\ifthirdargument
--% Replace by whatever you want
\expandafter\ByTwo
\fi}
\starttext
\startlines
\ByTwo{A}{B}
\ByTwo{A}{B}{C}{D}
\ByTwo{A}{B}{C}{D}{E}{F}
\stoplines
\stoptext
which gives

The same code works in LaTeX, if you copy the definition of \doquadrupleargument
from ConTeXt. Below I have included a slightly simplified code from syst-gen.mkii
:
\documentclass{article}
\newif\iffirstargument
\newif\ifsecondargument
\newif\ifthirdargument
\newif\iffourthargument
\def\dodogetgroupargument
{\ifx\nextargument\bgroup
\def\nextargument{\dogroupargumentyes\dodogetargument}%
\else
\def\nextargument{\dogroupargumentnop\dodogetargument{}}%
\fi
\nextargument}%
\def\dogetgroupargument#1#2%
{\let\dogroupargumentyes#1%
\let\dogroupargumentnop#2%
\futurelet\nextargument\dodogetgroupargument}
\def\doquadruplegroupempty#1%
{\def\dodogetargument##1%
{\def\dodogetargument####1%
{\def\dodogetargument########1%
{\def\dodogetargument%
{#1{##1}{####1}{########1}}%
\dogetgroupargument\fourthargumenttrue\fourthargumentfalse}%
\dogetgroupargument\thirdargumenttrue\thirdargumentfalse}%
\dogetgroupargument\secondargumenttrue\secondargumentfalse}%
\dogetgroupargument\firstargumenttrue\firstargumentfalse}
\protect\def\ByTwo
{\doquadruplegroupempty\doByTwo}
\def\doByTwo#1#2%
{{\bfseries #1} `#2'
\ifthirdargument
-- % Replace by whatever you want
\expandafter\ByTwo
\fi}
\begin{document}
\ByTwo{A}{B}
\ByTwo{A}{B}{C}{D}
\ByTwo{A}{B}{C}{D}{E}{F}
\end{document}