How do I programmatically remove allowed modules from a user? - ERPNext 14

So I have an after install script that adds a new user (system user) with the roles I set. But that user is getting all the modules enabled by default. How do I remove those modules? Or only set the ones I need?