How can I get rid of extra fruit or food energy?

You can rid of the energy by using it. Digging up and planting the same tree over and over again will work, and does no damage to the tree since you plant it in the same state as it was dug up, with even fruits left intact.

This Polygon article also states that toilets, if you can find one, can be sat on to uh, flush all of your energy away, but finding one will be tricky since it's not one of the default recipes, and just going to it will probably be slower than transplanting unless you accidentally ate 10 turnips.

Saving and re-opening the game by using the - (minus) key also works, but is also rather laborious, and will reset your location to your house.