I cannot comment on the Python code (same problem as Nablator), but from your description of the algorithm (provided np.bincount and joint[] do what you say they do, which I don't doubt), is correct and implements Nablator's formula. I'm (or better I was) used to call it self-correlation instead of mutual information but it looks the same.
Interesting, and a lot of data to digest before an answer. Welcome back, @quimqu
Interesting, and a lot of data to digest before an answer. Welcome back, @quimqu

