In general, for events you can just inline them. In this case it makes sense, since they're supposed to be used for events only and need not be local nor member functions.

```lua
windower.register_event('unload', function()
    for key, val in pairs(menu.list) do
        --[[ code here ]]
    end
end)
```