`sympify` input to codeprinters

Ensures expression is hashable. Fixes issue #7980.
Merge pull request #8004 from jcrist/issue_7980

`sympify` input to codeprinters