Shopify Scripts is a great (and fun) feature available for Shopify Plus merchants. There's lots of interesting things you can do with Scripts, with one being the ability to remove a discount code from the cart automatically.
A big reason why you'd want to do this is to avoid customers double stacking discount codes when you're already running a BOGO campaign (or any sort of scripted discount).
Let's look at a very simple script for removing any discount code, and see my github repo for more shopify snippets on Scripts.
grabbing the ruby script...