I have shot both side by side (I own a 31) and the 40 is better. Better colours (esp reds) and easily a stop better ISO performance (IMO more like 2).
Every time I read an informed comment like this, I curse PhaseOne for how they stupidly missed out on the best Kodak CCDs (the 6 micron series that Hasselblad, Pentax and Leica use), thus depriving us Mamiya shooters of their enhanced high ISO and long exposure performance.
There's a certain diabolical irony that Hasselblad can't (or won't) get long exposures out of their low dark-noise Kodak sensors; while PhaseOne, masters of long exposure electronics, partnered with high dark-noise Dalsa for all their latest sensors, and so can't get long exposures out of them either!
I'm telling you, if I could get infinity focus with my Mamiya lenses (inexpensive stunners like the 24/4 fisheye, 80/1.9 and 200/2.8 APO) on a Pentax 645D, I'd never look back. But Catch 22, the Pentax has the thicker body.
In frustration, I've even looked at the Leica S2, which will comfortably hit infinity with the M645 lenses; but it would need to be at Pentax pricing to work for me, and that ain't going to happen either.