Fix passing kwarg values '|' and '#'

Due to the fact that CLI kwargs for module execution functions are
passed through yaml.safe_load, certain values get mangled. This fixes
two such values. More commits like this may arise as other cases are
found. Fixes #6752.