I'm trying to implement hook_menu_block_tree_alter() in my module to add some analytic tracking code to a few specific menus, by adding onclick attributes. The same menu is used in more than one menu_block and because the data returned from menu_tree_page_data() is a reference, this ends up altering the links in all blocks where the menu appears, instead of just the block that matches the $config passed into hook_menu_block_tree_alter().

I'm not sure where the bug here lies, but this is somewhat unusable behavior.