Good afternoon,

here is something that looks like a bug.

A document-command with an _unused_ _trailing_ option swallows the space
after it:

  \documentclass[a6paper,12pt]{scrbook}
  
  \usepackage{xparse}
  
  \NewDocumentCommand{\myCmd}{ m o }{%
    \IfValueT{#2}{\typeout{+++#2+++}}%
    #1%
  }
  
  \begin{document}\Huge
    This is a \myCmd{test} foo. %spacing wrong
  
    This is a \myCmd{test}[bla] foo. %spacing ok
  \end{document}

This behaviour is new and probably not intended.

Kind regards,
Alexander.