40k is a good budget for a 911! You'll do well not to be too fussy with things like colour and exact things on the options list as you're more likely to bag a good car.
Prices unfortunately will be inflated at this time of year, but there are plenty to choose from. Interestingly low mileage gen 1's are starting to overlap in price with higher mileage gen 2 cars. The gen 1 carerra S and the gen 2 carrera are pretty much the same power, but the S benefits from PASM and larger brakes as standard. The non-S versions do benefit from cheaper brake components though! Both cars have their problems and a pre-purchase inspection is great for peace of mind, the dealer sorted a few minor problems which I would never have spotted otherwise. You can still warranty a gen 1 car if you like, however when I calculated the cost of getting mine warrantied it was getting close to the cost of an engine rebuild anyway (change tyres, major Porsche service, removal of bluetooth module, warranty cost etc etc). I ended up with a gen 1 because I wanted a low mileage, low owner car and couldn't stretch my budget north of £40k for a similar condition gen 2.
Things to consider - 2006 cars have an updated IMS bearing which apparently is much less likely to fail, but is harder to replace prophylactically. The RMS has also undergone continual evolution throughout the years so the later ones *may* leak less often. Bore scoring is a variable feast and can be fixed - gen 2 cars can suffer from this too (for different reasons) so not bad to take a look in the bores with an inspection. Best to buy one without it, love the car, put miles on it and like most high performance sports cars, eventually get the engine rebuilt.
Anyway, have fun looking for the perfect car! Good ones don't hang around!