As of 2.0, there is now a prototype for inventory bonus equipment: https://lua-api.factorio.com/latest/prototypes/InventoryBonusEquipmentPrototype.html
Using this prototype will also allow quality to affect the bonus, and remove (some) runtime scripting.