Folding shuffle algebras and twisted
q-characters