I should also add that I made a start on this myself some time ago, and I have placed the code in GitHub, https://github.com/maths/moodle-qtype_stack/blob/master/stack/maxima/elementary.mac
There is also a file of "experimental code".
The point of this is to define "elementary rules" which will transform the expression repeatedly.
Start in the Maxima sandbox and
As an example take your expression,
Now, we can apply "rules" such as "distribute unary minus over addition", this is called "negDistAdd"
Next, we need to use associativity of addition, "assAdd"
We continue with a rule which removed "--",
Notice, this sorted out the "-(-14*x)", but not the "-(-5)*x^2", but as I said, this code is experimental and I never finished this off.....
I hope this gives you some idea of the issues involved in making this work. I'm sure it is possible to do, however.