Bring back constant parameter inlining
This was stripped in the CasADi 2 -> 3 port, because external functions (e.g. via code generation) do not support expansion. Even with external functions we can still profit a little from the few ca.substitute() calls. The final .expand() only works for SXFunctions/MXFunctions that contain no external references, but could save a lot of time as well.
The parameter inlining also means that dynamic parameters make a return, as they should not be inlined.