Patching scikit-learn to improve API performance