Yeah I agree with Spiral, I think Gohan separated well the moments he had to be battle focused and the moments he just could dedicate to his passion. It's interesting that although Gohan doesn't like fighting, his kid self couldn't become immersed in the studies and even told his mom to give it a break when she tried preventing him from going to Namek, saying the situation all called for a change of demeanor and preferences. He noticed he didn't do his homework in the spaceship but that doesn't mean he's more battle oriented when the adrenaline was in the ceiling that time... not to mention he was still a kid. People say Gohan's pacifism came outta nowhere vs Cell, and in that I can agree it came a little off, since he had no problems killing bad people like when he killed Freeza's soldiers no problem. I also think Piccolo's constant reminding of Goku that Gohan hadn't the heart of a warrior was also weird considering that's what Piccolo expected and raised Gohan to vs the Saiyans, plus he knows Gohan has acquired way more experience in the battlefield after that. Could be though that Piccolo grew softer on that and more understanding of Gohan's lack of heart to deal with someone like Cell, in constrast to the Piccolo who tried pushing the enraged side of Gohan in the Saiyans saga.
I think that scene can still make sense in the context that it was the first time Gohan was given the main role and Piccolo knew his heart wasn't there, though still, Gohan noticing he wouldn't like to kill Cell was still a little off imo... he didn't try reasoning out with other enemies. Could be though that since Gohan was more matured there, he tried other ways to solve it in comparison to his earlier more explosive self, maybe, though he spent only a year in the RoSaT. Similarly, kid Goku ha no qualms in killing lots of Red Ribbon soldiers, but we know he became more of a pacifist as sparing Piccolo, making a case not to kill when he didn't need to in the Freeza saga, so that may be a similar situation in terms of maturing up moreso.
As for the Boo saga, battle and danger were over so it makes sense Gohan would take the time to dedicate to his academic life. There're some moments Gohan chooses to skip classes to train, but that doesn't need to come as an incosistency, as Gohan knew them fighting alongside Goku in the tournament was an unique opportunity and I'd say he still has some warrior passion in himself in spite of saying he hates to fight to Cell... I think fighting overall in a fun setting is something he enjoys, he just doesn't like when it's a matter of do it or die, though when times such as those come, he still doesn't open hand of making himself as available as possible, as seen in the remaining of the Boo arc.
@Sam you may chime in, boy!!!!!