400W is too low :) but 750W Bafang motor with non speed locked controller will get you to 50km/s without pedaling (not that I would recommend going that fast).
Likewise, poor cooling can lead to a 10x decrease in motor performance.
Cooling is usually the biggest limiter of power, but max rpm (before the thing blows apart) combined with iron saturation (effectively meaning the magnetic fields inside can't get any stronger, even with more current) can also be a limit.
50 km/s is over mach 145 :)