In Germany it is not illegal to steal food when you're about to starve. Would someone who does this still would have to face negative consequences because of this stealing in the future?
In general, in Buddhism taking without asking would still be considered unskilful. The relevant precept is adinnādānā veramaṇī sikkhāpadaṃ samādiyāmi "I undertake the training principle of not taking the not given". There is nothing to stop someone asking for food if they are hungry. Indeed by stealing one also deprives the other of the opportunity of gaining the merit of generosity.
There are NO valid justifications of any wrong deed.
MN 97: Dhanañjani Sutta — To Dhanañjani gives good and clear answers.
It's a valid justification to bear hardships, leave, starve and go beyond for holding on precepts.
[Note: This is a gift of Dhamma and not meant for commercial purpose or other low wordily gains by means of trade and exchange.]