I've used an extension cord so my pickup was 20 feet away, the exhaust pointed well away and downwind. It has worked for a few years, but the pickup resonates the generator's noise, similar to how a guitar body resonates the strings when plucked. So, placing the generator on the ground a good distance away solved both these issues. I still wouldn't run it all night long.
Unless there is a need to run the generator all night, I'd cut it off, unless there was a definite medical need, and even then, a lot of things like a CPAP can be put on batteries, or an inverter purchased and those run from the house battery bank.