I am pretty sure long aftermarket barrels for the 20 SHOULD work in the 40. Is there something different about the 40 slide?
The G34/35/41 slide is different, yeah. It was designed for 9mm/40 S&W. The G41 barrel is not only longer than the G21 barrel, it is also thinner in order to fit in the already too small slide. In fact the G41 barrel weighs exactly the same as the G21 barrel, despite being over an inch longer. (The G20 barrel is almost exactly the same OD as the G21 barrel, so the G40 barrel would also have to be almost equally thinner than the G20 barrel.)
I don't KNOW anything about the G40 for sure. But if it's the same as the G41, you can draw your own conclusions.
If it turns out the G40 is little more than a chamber reamed G35 on a G20/21 frame, I know what I would do. As a handloader, as are a lot of other 10mm shooters, I would buy a G35 and load it warm. And when the G40 comes out, I can maybe even buy a stock Glock heavy recoil spring. There is not a whole lot of difference between factory or mediumish 10mm handloads and hot 40SW. And if you want to explore nuclear 10mm loads, the G20 will still be the ticket.
I have reached max book loads for 10mm with my slowest suitable powder, AutoComp. In the G20, it feels just about the same as shooting my 40SW loads (in the G20) or my G21. If I didn't look in the mag, I wouldn't know what I was shooting, except that my 40SW ammo doesn't always lock the slide back. Double taps all day long, no problem. I guess I have to find some Longshot! The heavier slide, designed specifically for 10mm, is one of the reasons I wanted to get the G20, rather than a 1911 platform or a conversion barrel for my G21.