My wife was cooking a turkey leg/thigh quarter in the oven at 350. She turned off the oven after cooking and mistakenly left it in there for two days(!). If the leg/thigh was cooked to the right safe temperature to kill bacteria, and if 350 is hot enough to kill any bacteria in the oven, and if the oven was never opened after turning the gas off, would the turkey still be safe to eat?
I highly doubt that it would be safe, although I'm not certain that I can rigorously prove that it's risky. I've never heard of any principles of food safety that would establish it as being safe.
There are several reasons why I think it would not be safe:
Uncertainty about the temperature of the oven and everything in it
You mentioned an oven temperature of 350, but I'd imagine that this figure is based on what the dial was turned to when the oven was preheated, not based on a measurement with an accurate oven thermometer. Built-in oven temperature displays often aren't particularly accurate, and oven temperatures fluctuate over time, so it's not guaranteed that the oven was 350 °F to start with, let alone that it was at or above that temperature for an extended period of time.
You know for sure that the turkey was not at that temperature when it was put in, and so it's safe to assume that the turkey started out with bacteria. Since the oven was not opened after the turkey was cooked, it seems that the temperature of the piece of turkey was never verified with a meat thermometer, which is the usual recommended way of checking to ensure that meat has been cooked to a temperature that will reduce bacteria to a safe level.
Together, these factors create a large amount of uncertainty about the exact temperature of the oven and everything in it when it was turned off.
Bacterial spores can be hardy
I'm having trouble finding exact figures about the temperatures where bacterial spores die, but I have read that they can survive at notably higher temperatures than bacteria themselves. This page says that certain spores can survive up to 240 °F: ("Methods of Sanitization and Sterilization", by Maribeth Raines (Brewing Techniques)). Unless you overcooked the piece of turkey, it almost certainly never reached an internal temperature of 240 °F.
If any bacterial spores survived through the cooking process, the piece of turkey wouldn't be safe at this point.
Ovens aren't necessarily bacteria-proof
Again, I don't have good data about this, but as far as I know ovens are not designed to be bacteria-proof, so I wouldn't rely on that being the case.
Even a small amount of bacteria can multiply to unsafe levels in a single day
Basically, if any bacteria got on the piece of turkey in any way--surviving the initial cooking process, coming from spores that survived the initial cooking process, or coming into the oven after it was turned off--they have had plenty of time to multiply to unsafe levels. "Somewhat sterile" is not sterile, and is definitely not safe to leave in the temperature danger zone for two days.
Absolutely not. Leaving it in the oven for 2 days is pretty much the same thing food-safety wise as leaving it on the counter for 2 days. That's more than enough time for various unpleasant bacteria and their toxic byproducts to start forming. I would be surprised if the turkey isn't already smelling bad.
Since the oven is not a sealed environment, it will not prevent bacteria from entering once it's cooled down, so that it was in the oven does not give you any extra benefit after it cooled down. Heating to 165 degrees will kill what was in the thigh before cooking, but it will not prevent new bacteria from entering after it cooled down. Do not eat that turkey.