Be up front and honest with the restaurant
For example, if you are homeless and hungry, just ask the manager, “I’m hungry, homeless, and I have no money. Could you please feed me? I’d be happy to sweep and wash the floor, clean the tables, wash the dishes, or do anything else that needs to be done.”
Most likely, the manager would take care of you, and you wouldn’t have to do anything. At least you’re not asking for a handout. Otherwise, the manager may think you are trying to get money to buy alcohol.
If you ask up front, you may find a restaurateur who has a solution for you. This puts them in control instead of thinking you tried to take advantage of them.