There are basically three primary concerns when cooking your turkey: bacteria, spores, and toxins.
Bacteria: As you point out, since your turkey eventually reaches at least 165 degrees, all the live bacteria will be killed.
Spores: Some of the bacterial spores will not be killed, which means that as the meat cools, they will have a chance to grow again. (Some bacterial spores survive to 212 degrees or higher.) The longer your cooking meat is in the danger zone, the more spores will be produced, and the faster your leftovers may become unsafe to eat. This means that refrigerating or freezing leftovers promptly, and eating refrigerated leftovers soon, is especially important for slow-cooked foods. (Although, having said that, the smoke will act as a preservative, which may counteract this effect. The effects of the smoke may be mostly superficial, but as I explain shortly, so are the bacteria!)
Toxins: Finally, there's the concern you brought up: heat-tolerant toxins produced by certain bacteria while the food is cooking. Even in ideal conditions, most bacteria produce toxins very slowly, usually over the course of days. Most of the time that the food is cooking, though technically in the "danger zone," is not ideal conditions for toxin production. I've seen sous vide recipes that involve cooking ribs for 72 hours, and they remain in the "danger zone" for a significant fraction of that time - they are still considered safe to eat when finished.
Perhaps more importantly, the bacteria come from the environment in which the food has been. This means that on a whole turkey, they will generally be on the surface, which heats more quickly and also dries out first, slowing bacterial growth. In addition, the surface is exposed to air, and most toxin-producing bacteria only thrive without oxygen. This is why toxin-based diseases like Botulism are more likely in prepared foods, where surface bacteria are "mixed in" to air-free (and hence oxygen-free) environments, and usually eaten several days (or, in the case of canned food, months) later.
In short, it should be incredibly unlikely, and maybe entirely impossible, for dangerous levels of toxins to build up in the 12-18 hours that your bird is cooking.