Why is C used in many optimization libraries?

Oh I agree totally! That’s a fine approach. Then you have it in good shape for further modernizations if necessary.