I do not see the need of a solution with side-effects. What about passing the ```tag``` instead of attaching it to an object (e.g. bundle in a new object both the rupture and its tag)?

the event loss table is exported in ```openquake.engine.export.risk```. Yes, we need to export the tags instead of database ids.