I enjoyed band so I took it and they didn't have an honors or AP version. So for me to maximize my GPA would mean that I would have to forgo band all four years of my high school existence in order to min-max for GPA.
And indeed, I believe the valedictorian did exactly that, for exactly that reason.
That is indeed exactly what happened -- the valedictorian was in all of the same advanced/AP classes as the rest of the top 10 students. But while each of us had additional classes like band, choir, or drama, she simply took the minimum number of credits, and as a result ended up with a slightly higher GPA. I actually ended up dropping all the way to fifth because I was taking math at a local college (multivariable calculus, linear algebra) which was treated as an ordinary course for GPA.