Or you could just eat less carbs. Carbs are not essential to thrive no matter what anybody says. I'm in better shape than most people at my gym and I've eaten <50g of carbs for years.
Your body is extremely efficient at using fat as fuel, creating its own glucose (gluconeogenesis) from proteins, and creating ketones.
Using medication to correct poor diet choices is a band aid which does not solve the problem, only masks it. There are side effects to taking Metformin such as b vitamin deficiency and a host of mineral deficiencies.
Too many people want a magic pill to solve their poor lifestyle choices, such as statins and blood pressure medication, or metformin. The body is capable of healing itself if you treat it right.