Why and is there a solution?
\documentclass{article}
\usepackage[utf8]{inputenc}
\inputencoding{latin1}
\usepackage{xparse}
\usepackage{etoolbox}
\ExplSyntaxOn
\tl_const:Nx \lang_and
{
croatian=i,
czech=a,
hungarian=\'es,
% romanian=\c{s}i, % ERROR: Illegal parameter number in definition of \erw_foo.
slovak=a,
slovenian=in
}
\ExplSyntaxOff
\begin{document}
\ifcsdef{c}{
romanian=\c{s}i,
}{}
\end{document}

\c{s}does not survive the\edefof\tl_const:Nx, with\tl_const:Nnthere is no error. – moewe May 29 '20 at 04:11\cis not expandable (neither is\': try\show \lang_andto see), and it explodes withxexpansion. Either use\tl_const:Nnor use\exp_not:n { romanian=\c{s}i }to avoid the expansion of\c. Besides the name of\lang_andis wrong: something like\c_erwann_lang_tlwould be better. – Phelype Oleinik May 29 '20 at 04:11x? – egreg May 29 '20 at 08:37