Don't stay in Munich. Already pretty booked up and expensive in that period for what's left.
Good that you want to explore. There are some great towns you can visit without setting foot in Munich (except for O'fest and whatever sights you have in mind) and without sleeping there. Here's a plan that should work across 5 days:
Freising for 2 nights... then Regensburg for 2 nights... arrive in evening of Day 5 in Salzburg stay. Details:
Day 1: 10 minute train ride from the airport to Freising. Do the Weihenstephaner, see town.
Day 2: Direct train into Munich (27 minutes on the direct RE train) for O'fest; return by the same route in evening.
Day 3: Direct Train to Regensburg, takes 1 hr. (UNESCO World Heritage medieaval town center.) Drop bags at hotel, tour town.
Day 4: Direct Train to Nuremberg, takes 1 hr.; full day there, return to Regensburg in the evening.
Day 5: Check out. Direct Train to Landshut, takes 45 minutes; drop bags in a station locker for sightseeing stopover for a few hours. Direct train in afternoon to Salzburg, takes 2.3 hrs.
It's possible that Freising is already impacted for your dates; if so, you could book LANDSHUT instead for 2 nights and get into Munich from there.