Done that
I've pulled mine several times by myself.Tie some heavy lines arount the mast above the spreaders, then around the boom at the point where your blocks attach. It wil stretch quite a bit, so allow extra length for that. Run another line to each jib sheet winch to keep things stable. Adjust them as needed. Then use the normal mainsheet blocks run to a winch to lift it. Use a block and tackle, like a boom vang, on the back of the motor to the rear bulkhead to hold it back as you lift it. As it comes up, slowly let it forward until it doesn't need the block for fore and aft control, then move the block and tackle to the front, using the mast for an attachment point, pull it forward until you can set it on the floor.Use some thick plywood to protect all the wood on the boat that the motor will be passing by. Also, use some where the lines will touch the wood in the companionway, as they will damage the finish and may even cut into the grain.You can raise it all the way out and set it in the cockpit if needed, but for your situation, I don't see why you would need to.There is no need to remove anthing like "open the cabin house to get it out" to do this.Mine is the 3QM30 30 hp at about 800+ lbs, but I imagine your 40 horse will be no different. You might have to juggle it a bit if you take it all the way out, but it shouldn't be a problem.By the way, I did this by myself with no help the first time just to make sure I could, so with help, it should be fairly simple.Write if you have questions.