Have you taught students before? Many will spend inordinate amounts of time to not learn the material. Often times it seems there is no friction too great if it allows one to not think too hard.
Of course the death blow for this sort of cheating is the exam, which you weight quite a bit more than the homework. A student who just copy and pastes code will still fail the class, since they can't use chatgpt in the lecture hall during exam time.
Ex: https://null-byte.wonderhowto.com/how-to/make-your-own-bad-u...
The device can make network connections, right? Someone's going to come up with a very short program you can type by hand, compile, and then pull down arbitrary other code over the network.
Its a classic arms race, but at the end of the day with enough effort on the issue, IT departments will either win entirely, or make it hard enough to cheat for the vast majority of users that only the extremely small minority who do manage to cheat probably deserve a cs degree. If its hard people won't do it, just like how they keep buying textbooks because finding a free pdf online is only slightly harder, but enough effort to put off most people from forcing campus bookstores out of business.
But while we started with a "just issue an rPi" we're now at "issue a modified laptop running a large amount of custom security software".
If the problem gets widespread, seems like there are possible responses that could and would be made. Just like how in time, schools went from letting you upload your essay and that's that, to running that essay through plagiarism software and baking the tech into their disciplinary process.