I think there are many simple ways to deal with it, to varying degrees of impact. Just taking the median rather than the average will be a step up, since extremes at both ends don't have outsize effects on the data. Or consider the students last few grades only. You can average them for an easy fix, or think about trajectory--is the most recent grade reflective of increasingly high grades and thus potentially valid, or is the data more erratic?
You're right--if they can ace it with no effort, why are you penalizing them for knowing it? This is a consistent problem with gifted children--they don't care about the busy work they're given, and then get penalized for being knowledegable.
Honestly though, grades are generally a pretty broken system and in the US they get used very inappropriately such as giving a kid a 0% for not putting their name on it, or even for not doing it (think: how does no data about their math work tell you that they can't do math? It has nothing to do with actually achievement of learning, which is what grades are allegedly for, and everything to do with work habits, which don't really involve math understanding). Grades also don't encourage learning--they see the letter or percent and then ignore all feedback.
The better solution to grading is feedback, and rubrics help with that. But there are less "drastic" changes that can be done as well.