I used to sneak SO many tamagotchi into school. I ran up to 7 of the vintage tamas and connections at once in high school. And I was BRAZEN about it, wore them all on a very loud lanyard as they rattled when I walked between classes.
Now this was 10 years ago in a public school and I'm sure some teachers are stricter than others.
1. Check your school's rulebook. There were "no cellphone" policies but I don't remember there being a "no handheld games" policy. There also wasn't a PDA policy so I often brazenly brought mine and took digital notes or read books on it when I finished my school stuff.
2. Don't even think about your pet during classes with strict teachers.
3. With the really chill teachers still be sure to keep your pets on mute, and don't be brazen with your pets.
4. If you're worried pause it when you get to school and reboot/unpause it after classes end when others bring out their cell phones.
I have a friend who is a teacher and when she confiscates stuff from students she sends it down to the office so they can deal with the parents. Meaning your parents will likely need to come in and pick it up. Kids who were caught with their phones or Nintendo DS during class would get written up.
For me, I wasn't worried if a Tama got taken, they were only ~$15 for the nice newer ones but most of mine were thrifted or clearance finds I'd bought for way less. That said, I never had an issue personally.
So, to sum it up, with how pricey tamagotchis are now, I would simply do the turning it off before going to class, and turning it back on when leaving school method. Opting to just abandon it at the hands of the front office would be a pretty expensive screw up to avoid getting in trouble with one's parents. And if your parents have to go in, odds are both your Tamagotchi would get taken away by your folks. They obviously care about your education if they're going to send you to private school, so it sounds like they'd take something like that pretty seriously.
That said, vpet care gets easier with many jobs once you graduate. These days I check on mine during my work breaks as we can use whatever gadgets we want during breaks.
It's not nearly as strict as school was.