Minecraft wiki entry for Hunger_management, associated text: Death
A last-ditch measure: If you're close to your bed or spawn point, stuff your inventory and armor into a chest or two … then die. On hard mode, you can just wait to die of starvation, otherwise, good methods are drowning, jumping off cliffs, or dropping gravel or sand on yourself. You will respawn with full health and hunger bars, and can then reclaim your stuff. Naturally, this method doesn't apply in hardcore. Note that this isn't a totally free solution: you lose most of your experience.