People keep saying that an unlocked suspension fork sucks up energy ... but this is wildly overrated.
If you are unable to ride without your suspension fork bobbing up and down ... then you should work on your pedaling technique.
For good efficiency, pedaling should be a circular motion.
There should, if you do it perfectly right, not be any force on the frame and the fork ... because all that force is wasted in frame flex, fork flex or tire flex.
You don't want that ... with or without a suspension fork, because waste is waste.
In fact ... a good way to improve pedaling technique is to do exactly that: ride a loose suspension fork and try to not bob it up and down while riding!
Your pedaling efficiency will improve.