It is difficult without knowing the person. If the teacher is like me, the best generalist gift would be a very good bottle of something alcoholic. Personally I'm not a fan of the usually suggested contraptions and thingamajigs. Don't get me wrong, when I was 14 I would have killed for a Klein bottle or a Gomboc, but now I'm not into "objects" anymore, especially those whose only function is "exist" (and catch dust).
But maybe she/he is into this kind of things. You can stalk the teacher a little and learn what other interest beside math they have...