Restrict other Admins from using Editor in Admin Panel

The Admin and Super Admin roles are the only ones with access to edit themes. If you’re wanting to give other people all other “Admin” capabilities but not access to edit themes, it’d probably be easiest to add the User Role Editor plugin, duplicate the Admin user with a new title and then just un-check the “edit_themes” capability for that role.

If you want to dig into the code a bit, you could use the ultimate guide to roles and capabilities to hack together a solution.

I’d strongly urge you to NOT hack the WordPress core, as that leaves you SOL the next time they release a new version.