Optim.jl from Julia will work with the number types that you give it, so if you make it use BigFloats then it'll do that. Local derivative based, derivative-free, global, and integrates with automatic differentiation. From Julia, it's just:
rosenbrock(x) = (1.0 - x)^2 + 100.0 * (x - x^2)^2
result = optimize(rosenbrock, big.(zeros(2)), BFGS())
and that's using arbitrary precision bigfloats, so then
setprecision(512) would be how you set the bit size.
For using it from Python, you can use pyjulia through
python3 -m pip install julia and then just do the call:
from julia import Base
from julia import Optim
[(1.0 - x)^2 + 100.0 * (x - x^2)^2]
result = Optim.optimize(rosenbrock, [Base.big(0),Base.big(0)], Optim.BFGS())
Should be all it takes? (I didn't double check to run it, but from diffeqpy I have used this a bit and am extrapolating the semantics a bit)
The only other thing I can think of would possibly be something in Boost, since most of Boost is templated.