As an optional enhancement, does transposing help here? I mean, something similar to a fast_dot, which recently made it into scikit-learn.

A disconnected question is the number of copies. Does one actually need to explicitly make a copy of B? I've to admit I'm not sure what f2py does under the hood and if this can be controled. I guess it makes sense to figure these things while both this and trmm is fresh.