If i were to write an essay on a model occupation, I'd write it about the US occupation of Japan. I have qualms with Macarthur, but not with his handling of the Japanese occupation.
He was wise enough to allow Hirohito to maintain his office, Hirohito would oversee the civilian authority at the expense of adopting the Potsdam accords and ousting the Japanese military command. Later during the rebuilding process in 47 many of these purged leaders were actually allowed to return to their govt offices. This helped build trust and continued support for the transition into constitutional monarchy.
You mentioned Okinawa and the rapes, and that's actually an interesting facet of the occupation.
The Japanese civil authority actually organized hundreds of thousands of women into state run brothels out of fear that American GIs would go rape crazy. Macarthur nixed that in 46 as undemocratic (though voluntary prostitution was still allowed) and by the end of the occupation mainland Japan had less then a hundred reported cases of rape.
That was largely a response to the 10-20,000 reported rapes on Okinawa during the occupation, and a reason the 21st century US soldier rape incidents on Okinawa caused so much outrage.
There is no perfect occupation, but the Japanese occupation is one of the best IMO. They were able to rebuild the economy of Japan, not overreach into civil matters and create a stable country and important regional ally. I'm a fan. I feel like Japanese favoribility ratings of the US would support my conclusion.
Afghanistan is about the worst occupation you could imagine. We lacked the translators needed to communicate, we hadn't killed all their fighting aged men like in Japan, Islam is very different from god emperors, and the state of Afghanistan was more a collection of 40 some odd tribes with their own idiosyncracies we were never able to understand and manage. Maybe if we glassed them first like Lemay would have recommended it would have gone better, but who outside of Minnesota lawyers wants irradiated opium.