I just discovered a sheet pan in my oven that must have been there for well over a month or more. It looked like it had been used to bake chicken and there was a burnt outline of the pieces, but there was no mold, only a rancid oil smell. I took the pan out and have had the oven on at 450 degrees for about an hour. Is the oven safe to use to bake cakes and cookies?
The oven is safe. When you bake chicken plenty of fat ends up on the inside of the oven, the chances are there's more on the oven walls than the pan you left in there. You don't need to run the oven for hours to make it safe -- by the time it's up to temperature any nasties will have long been fried.
The pan should be fine, too, after a good soak and cleaning.
For complete peace of mind you might choose to do an oven clean. It is not required, but will help you feel more confident.
There are spray-on products which will foam up sit inside your cold oven overnight and soften/lift grease and baked on grime. Next day you can wipe it off with a damp paper towel or cloth.
You can spray this cleaner on your tray/s and shelves as well, it won't harm them. Likewise, the inside of the window can be sprayed this way.
Do be aware that these cleaners are strong and nasty. You want good ventilation, no kids/pets in the kitchen, and a window of a day or two where the oven won't be needed.
If one night doesn't get it all, you can simply repeat. I once had to do 4 cleaning passes on an oven that hadn't been cleaned for many years.
Some fancy modern ovens have a "self clean" function which means they run at a very high temperature for a while. This may or may not not be able to remove the smells.
You should read the manual for your oven to see if it has such a function, and whether that prevents doing a chemical clean.