assuming a 16t front (OEM on the '07, I believe), the 38 tops out at a theoretical 157mph, ignoring wind resistance. With a 40t, the theoretical top speed is 149mph.
In reality, you hit an aerodynamic brick wall in the high 130s/ low 140s (indicated). The non-so-aerodynamic superduke's top speed is limited by that, not gearing. The upshot is that in the real world, you lose NO top-end by fitting a 40T. You will top-out in the 130-140 range regardless of what sprocket combo you have. The only downside is slightly higher RPM at cruising speed. The upside of course is much better acceleration and easier wheelies.