Many terminal-based programming environments allow you to run code - you essentially just need a REPL, but there are more sophisticated environments that could still be considered 'single purpose'
Pretty clearly it has to have a way to run the programs you enter as you're learning to program. Otherwise it's a lousy device at teaching programming.
Yes, learning programming because that's what you do on the learning-programming-machine is a great way to convince people that learning programming is a waste of time.
You learn programming so you can do the things you want to do. Handicapping the device handicaps the whole project.
On the other hand, if your machine is able to run the programs you write, then it isn't a single-purpose device.
I think you're confusing purpose with functionality; they're not the same thing. Designing with a single purpose in mind determines the needed functionality; it does not limit it. Instead, the purpose supports the design decisions in relation to functionality.