So you have already checked and double checked every hose connection and hose itself between the MAF and intake plenum? The large ribbed hose is a common leak point. Also just because it does not leak while testing at idle does not mean it will not leak when under hard use.
Cleaning the MAF and TB will not solve a 0171 unless maybe the leak is at the gaskets and new ones are put on - test them with non-flammable spray.
Here is the part I replaced to solve my 0171 on an 01 - use Only OEM - just look how long it lasted. Luck and enjoy your Runner.
That air intake elbow was the very first thing I did to my 4Runner when I bought it. It was original piece and had a crack on one of the folds. Ran a lot better after that. I since moved to an Airaid which reduced the potential points of failure. Next I replace the TPS but I don't recall why. It wouldn't hurt to hit the MAF sensor with a can of cleaner before buying a new one, if you haven't already.
You can remove the hose and clean the flap and carbon buildup on the throttle body, cleaning the maf is not going to hurt anything. Obd tool could help you diagnose if the oxygen sensor is functioning.