Did you try using the previous configuration as an initial guess to the numerical optimizer? If the next position is close to the previous one, the solver should be very quick.
Also, you can probably get much faster results if you obtain the gradient of the forward kinematics.
https://github.com/AnykeyNL/Quincy/blob/master/coordcalc.py#...
There is a loop in a loop that goes through all the possible values of x and y to find the correct ones. No wonder it's so slow!
The scipy solver - inspired by the original article, I used https://docs.scipy.org/doc/scipy/reference/generated/scipy.o... - isn't much faster though (from reading the docs, it's just a smarter random search).
I guess it's time to learn some linear algebra (again!) and create a custom algorithm.