40 hp= 2 cylinders? Is it for sure running on both cylinders? If one of the high end jets on the carburetors is plugged, the boat will idle good but run bad at wot (wide open throttle).
I have never herd of different gear ratios on standard outboards. The spun hub could be the culprit. If you have a spun hub, the engine will race at high rpm and the boat will go slow. A spun hub will let the boat move at idle speed like normal.
My guess is the carburetor is plunged.
Buy a can of Seefoam and run it through the engine with a can of gas. That stuff is the best.