How should I request a professor to restrict communication to email?
I don't think there is anything especially unprofessional about communicating via instant messaging. Email is a naturally asynchronous communication platform, and sometimes you need a synchronous method to contact people.
In my research group, we use a specific professional instant messaging application - Slack. I did this because I feel it's important to keep work and private life separate, but still need a way of communication synchronously with my team. Students/postdocs may exit/silence the app when they feel they are not on "work time". Your institution may also have such a system - Microsoft Teams, Google for Education's Chat and Facebook Workplace all offer similar functionality depending on which your university runs its IT systems on.
I should also point out that the opposite problem is also true. My students definitely think it's a bit weird that I refuse to be on their WhatsApp group.
That said, if instant messaging makes you uncomfortable, you should tell your supervisor this. There is no reason to lie about the reason - you shouldn't even need to offer a reason. You can just say "I'd rather be contacted by email unless it's a real emergency, if that's okay.".
EDIT: This answer was written before it was clear that the OP was an undergraduate in a class, not a post-graduate communicating with their supervisor.
I do think it is a bit weird for a professor to be communicating, one on one with undergraduates in their classes via IM.
There are situations where some sort of chat system might still be a good way to communicate with students (I use slack in a large, long-term, practically based course I teach), but I do think personal IM is best avoided with undergradutes.
I don't think this changes the course of action, which would be to contact the prof and say you'd rather the contacted via a different means (see @henning's answer).
Are you overthinking this?
Perhaps. As the range of answers suggests, customs with regard to instant messaging are currently changing. E-Mail is still the main channel for professional communication, unless you are working closely together. But IM is catching up in this setting as well. As customs don't offer clear guidance, what really matters is your preference and hence your other question:
How should you request a professor to restrict communication to email?
"Polite, direct and succinct". It could go something like this:
Thank you for your message. By the way, I prefer e-mail to IM when it comes to university matters, and I would appreciate it if we could use e-mail going forward. Thanks!
This could surely be phrased more elegantly, but the point is to just state your preference and ask clearly for what you would like the instructor to do - neither getting defensive ("Sorry, but I often mute my messenger app") nor assigning blame ("I don't want to be stalked over a private channel").
I'm going to go a bit against the stream here, and say yes, this is unprofessional behaviour, given the circumstances a) that this is a professor teaching an undergraduate course, where there are surely more official channels available, and b) it was the professor and not you who initiated this communication.
There are two main reasons for me to say that this is unprofessional.
The first one is, that the power balance in this relationship is very uneven. In the situation as presented, the student can very easily feel pressured to keep a conversation going in order not to disappoint the other end, and most IM systems allows people to see when a message have been read. For IM systems as such, this is a nice feature, but it also lends the system to more informal conversations than normal email, and in this case it seems that the student has no way of expressing that they are not interested in informal conversation without the possibility of a negative back-reaction. (with email you can much easier stop answering)
The second reason is, that since this is likely an external service, the university can not keep records of the correspondence. The requirement of record-keeping is becoming more of a rule, in fact at my university we are required to keep correspondence to work email only. This rule is for sure something which is often broken in contact with colleagues or PhD students, but if I was caught messaging an undergraduate student over facebook/sms/skype/whatsapp/..., I would for sure be reprimanded and told to use either email or the university supplied system for course messages.
I have to add: This may not be of ill intent. This could simply be the case of a good teacher, who is not following all the latest fads, but in a misguided way is trying his/her best to meet young people where they are. This might not be taken out of thin air, I have in several cases had students contact me on IM services, or even on my personal phone number, where they should have used email. In such cases I have had luck with simply asking them to please use email. In cases of IM services I have often added that I simply don't check this service often enough for contact to make sense.