What body mass index is optimal for longevity
Overall, if you have BMI 20 - 30 and adhere to dietary guidelines, mediterranean diet, physical activity guidelines, and your waist is preferably <90cm it should be safe. Check your doctor or at least check your glucose level if there are any doubts.
BMI 22.5 - 25 is probably the safest for most people. For people with large muscle mass, slightly larger BMI might be better.
Meta-review >1mln people - almost no difference between BMI 20-22.5 and 22.5-25, but perhaps 22.5 - 25 is more safe
Prospective study 38k people - almost no difference between BMI 20.5-22.5 and 22.5-25, but 22.5 - 25 is probably more safe.
https://pubmed.ncbi.nlm.nih.gov/24582192/ BMI 25-27.5 with waist <90cm might be the best option.
When following the Mediterranean diet, BMI 25-30 was slightly better than 20-25 https://pubmed.ncbi.nlm.nih.gov/32941436/ 79k Sweden citizens (30k died during follow-up). Among people adhering to Mediterranean diet, BMI 25-30 was associated with less all-cause mortality (RR 0.94, CI 0.90 - 0.98) compared to BMI 20-25. It's about plus one half year. Even BMI>30 if well adhered to Mediterranean diet almost didn't increase all-cause mortality (RR 1.03, CI 0.96 - 1.11).
Meta-analysis https://pubmed.ncbi.nlm.nih.gov/27423262/ BMI 20-22.5 equally good as 22.5-25 and better than others.