In Office 365, the IRM solution has many impacts on the licensing model.
In some cases, you can have to implement the IRM option for only a couple of site collections, with a limited number of persons.
The issue is from license point of view, because the IRM activation is at the global level, but when it's done, any TeamSite Content Manager can enable the option into his list. But when it's done, the users who will access that SPList will have to be licensed with E3.
So to limit that license gap impact, you can use the following script preparing a CSV file like: