Also, one should be aware that temporaries can appear in many situations in NumPy, it is not exactly easy to predict when this is going to bit you. In Warren's example he already noticed that the difference in performance was only noticeable when a complex expression was used ('z.real**2 + z.imag**2', so with temporaries), whereas a simple expression ('z.real + z.imag', no temporaries) did not trigger the behavior.
Well, I can see `mallopt` handling being useful just for NumPy purposes, but it is up to you to decide where to put this logic.