The response from Slack is technically correct, but incomplete.
API method for deactivating users
There actually is an API method to deactivate many users at once called:
So you can create a simple Slack app that would allow you to deactivate a batch of users in one go. However, there are two caveats:
that API method is undocumented, which is why the Slack team will never tell you about it
it only works on payed teams, which as I understand you do not have
Please check the linked documentation for details.
There is another approach, which is organizational. Instead of removing former students from the slack workspace completely you could focus all relevant communication on one or several private channels. By inviting and kicking users from those private channels you can ensure that only current students have access.
Removing users from a private channel is easy:
/kick @user in the channel
- click on the name in the member list and choose "kick"
- create a simple Slack app that removes a batch of users by calling the API method