It's a common misconception that Tupac was a gangster or rapped about nothing but gangster rap. Most of his songs that people view as "gangster" were really cautionary tales. He also has a ton of songs that don't involve drive bys, calling women bitches, etc etc.
He recorded more songs during his short career than most rappers do in their entire lives. Most people simply haven't delved very far into his catalog honestly.
Probably describes me pretty perfectly. Once rap went into the gangster rap stuff, I stopped listening and pretty much have it all lumped in together.