The solver is getting the same error every try, which makes it stop with a GRADIENT_TOLERANCE.  The getBezier drawn at the end isn't coming out right visually so probably that function is partially at fault.
Fixed problem with the getBezier wrapper function that takes a param pointer, but the errors are still coming out all the same even with variations in the parameters.
Somewhere the points are getting rounded to ints which would obviously be the fault of the solver not working.
Even after fixing the obvious source of int conversion, it seems like all the residuals are coming out the same - though that may be an artifact of not printing out enough decimals.  Could try subtracting the expected shortest line distance from the residual.
Finally can turn a curved line into a straight one (brilliant right?), takes about 5 ms
Clean up a little, also making sure more points works.
The solver isn't doing real well with the BezFunctor- does the residual need to be computed differently to guide it better?
Works decently with one obstacle except when it is nearly passing through the center- in that case it doesn't know where to go (and usually chooses wrong)
2 obstacles works okay again only when the initial line is not near the center of either.