The Lucky Country is easy: when you get out of customs with your bags, and are in the entry hall, wander over to the mobile carrier booths (I go with Optus) and buy a short term data plan. Make sure the APN is configured, then walk away and enjoy.
Rates are reasonable for a traveler. I buy the daily unlimited plan ($2 per) and count days: $20 for ten days. Using airplane mode, you can skip days when you don't need it. It only counts a day in which the phone is in-network and connects.
Keeping the number is a bit complex. It expires from non-use after six months, but it is possible to refresh online from overseas. I plan to try that before I go next time, allowing me to walk off the plane and be connected.