Are food rewards a good long term learning strategy?
Food rewards are effective and safe to use in principle.  But in practice...?
The non-caveman term for the process of using consequences to modify behavior is operant conditioning, and the specific use of rewards is called positive reinforcement:

Example: A father gives candy to his daughter when she tidies up her
toys. If the frequency of picking up the toys increases, the candy is
a positive reinforcer (to reinforce the behavior of cleaning up).

Notice the very specific phrasing of this example as an if, rather than an is - that is, food rewards are a reinforcer only if they work.  This means that in order to know if they work, you will have to try them out, it is not something that can easily be predicted in advance.
Positive reinforcement using a variety of different kinds of rewards (tangible rewards such as food, prizes, privileges, and intangible rewards, in particular social rewards such as praise, attention, and affection) are a mainstay of behavioral therapy (BT, including CBT).  If a parent consults a behavioral therapist for help with a child struggling with homework, then the therapist will likely start with an assessment that includes determining what reinforcers the child may respond well to, as well as possible obstacles to progress.
Behavioral therapy is commonly used with children, particularly children with learning difficulties such as autism.  Since autistic children may initially respond less favorably to certain kinds of social reward, other rewards such as food may be used in early sessions, though patients are ideally weaned off tangible rewards in favor of intangible ones before completing treatment.
Behavioral therapy using positive reinforcement is one of the most evidence-based and effective approaches in the field.  However, parents attempting to replicate this process outside the lab or clinic are recommended training, as they may run into a number of pitfalls.  As a starter on reinforcement training, I recommend the great, accessible, and very short book Don't Shoot the Dog!