gh-37836: fricas/do not get inputform twice
By mistake, we were previously converting the InputForm to a string
twice, which would be quite costly especially for large expressions.
URL: https://github.com/sagemath/sage/pull/37836
Reported by: Martin Rubey
Reviewer(s): Dima Pasechnik