My mother has a theory about why genes that pose higher type 1 diabetes risk are as common as they are. She thinks they lower the risk of cancer. This makes a little bit of theoretical sense, because a strong immune is more likely to kill off cancer cells. Does it hold up to the evidence?
I am not aware of a study of cancer rates in relatives of diabetics, and having diabetes doesn't tend to extend people's lives. The evidence does suggest, however, that type 1 diabetics are less likely to develop and die from cancers.
Type 2 diabetes (or maybe the insulin resistance) almost certainly is a cancer risk:
Japanese study on cancer death risk and impaired fasting glucose
Meta Analysis of studies with a total of over a million men concluding that diabetes is a risk factor for prostate cancer
Strangely enough, right after that I found this article about the reasons diabetes is protective against prostate cancer- go figure.
Australian study concludes higher breast cancer risk for people with type 2 diabetes
But type 1 diabetes, if anything, is protective.
Although type 1 is a risk factor for a handful of specific cancers.
Acute Lymphoblastic Leukemia is often diagnosed within a year of type 1 diabetes. Although I'll admit to wondering if the diabetes in these kids is misdiagnosed as being type 1.
Most studies on cancer rates and diabetes has shown that type 1 diabetics have about 95% of the cancer risk of non-diabetics. That is, we are 5% less likely to develop cancer than other people our age, which is not a huge difference, but which is considerably more interesting when you figure that type 2 diabetics have a cancer risk that is higher than that of age matched non-diabetics. And, this is also despite the fact that type 1 diabetics are at increased risk of a few specific cancers (stomach cancer because of celiac, pancreatic cancer because things that don't work right are more likely to become cancerous, ovarian cancer probably because of the increased PCOS, leukemia probably because its a white blood cell thing).