I don't think this idiom is as common as you think. Most of the time, the `free` is a custom free function, not a generic callback. I think the `foreach` macro is doing its job just fine here.