Metformin is an old and cheap drug that has been used extensively to treat type 2 diabetes by decreasing insulin resistance and increasing blood sugar utilization. Besides effects in treating type 2 diabetes, recent studies have suggested that metformin could have other important health benefits.

Metformin may slow down cognitive decline
A study published in the prestigious journal Diabetes Care showed that cognitive function decline in patients with type 2 diabetes who used metformin was slower than that in type 2 diabetics who did not use metformin. This study was conducted in a total of 1037 Australians aged from 70 to 90 over a 6-year span.

Given that patients with type 2 diabetes could have a staggering 60% risk of developing dementia, a debilitating neurological condition, this study shed new light on protecting brain functions in patients with type 2 diabetes.
Metformin may lower the risk of various cancers
Studies have shown that metformin can prevent and treat different cancers with efficacy, such as colorectal, pancreatic, endometrial, gastric, renal, lung, breast, prostate, cervical, and ovarian cancer. However, the authors caution that the evidence for this claim is not definitively established. More studies are needed to confirm this.

(Reference: pubmed.ncbi.nlm.nih.gov/29663879/)
Metformin may lower the incidence of stroke in type 2 diabetics
Stroke is a serious neurological condition that occurs when the blood supply to a part of the brain is interrupted, making the brain tissue lacking oxygen and nutrients. A study published in the Journal of Stroke and Cerebrovascular Diseases reported that 17.5% of the type 2 diabetics who did not take metformin experienced stroke, whereas only 9.2% of those who took metformin had stroke.
(Reference: www.strokejournal.org/article/S1052-3057(13)00357-1/abstract)
Metformin may help protect against heart problems
Patients with type 2 diabetes are at an increased risk of developing various heart problems, such as heart failure and acute coronary syndrome. A study in the journal Nutrition, Metabolism, and Cardiovascular Diseases found that metformin could protect the heart blood vessels and the coronary artery from the oxidative stress associated with high blood sugar levels.

(Reference: pubmed.ncbi.nlm.nih.gov/28709719/)
The bottom line
Metformin seems to be a wonder drug for everyone, while actually it is not. The benefits of metformin mentioned above need to be studied further and it can only be used as your doctor advises. It cannot be used if:
1) You are currently having an infection
2) Your blood sugar is low
3) You have serious damages to the liver or the kidney with high liver function tests and decreased glomerular filtration rate (eGFR < 45 ml/min/1.73m^2)
4) You have a fever
5) You have gastrointestinal problems, such as vomiting or diarrhea