role_assign() at system level will call forum_add_user_default_subscriptions on CONTEXT_SYSTEM and thus new admins etc end up subscribed to a lot of forums in all courses.
Rather than adding more hardcoded roles about which contexts or which roles this should apply to, let's add a new capability like: mod/forum:initialsubscriptions which is by default set to ALLOW for teachers and students only.
forum_add_user_default_subscriptions() then just needs this near the top, before the case:
if (has_capability('mod/forum:initialsubscriptions',$context, $userid, false))
{ return true; }This lets the admin control exactly which roles should be processed in this way.