Fix argument parsing for arguments containing pound signs

Passing these through yaml.safe_load() will result in the pound sign and
everything after it being interpreted as a comment. This commit stops
the argument from being passed through yaml.safe_load if it is a string
and contains a pound sign.
add test case for #8585
Merge pull request #9039 from terminalmage/issue8585

Fix argument parsing for arguments containing pound signs