Scikit learn kmeans with custom definition of inertia?
K-means cannot optimize arbitrary measures.

The mean optimizes squared errors. It does not optimize, e.g., Euclidean distances, Manhattan distances, etc. It won't crash, but the solution will not be optimal (not even locally) because the centers are not well placed.

So it makes little sense to add support for another "inertia" inside k-means (nor other distances), as it can't optimize that.

If you want to optimize other distances, there is for example the PAM algorithm, and k-medians (for Manhattan).

There is nothing wrong with computing such a quality afterwards though, but then it belongs into the evaluation package, not in the KMeans class.