Larry nice proposal. but doesn't module_invoke_all already do basically what you're describing without the caching and naming enforcement? I agree with the naming convention, but not the enforcement.
Maybe we just need a module_invoke_all_cacheable($expire, $hook, ....) {
// expire is same as cache_set, only CACHE_STATIC indicates use a static var, no db.
static $cache;
$cid = $hook .':'. md5(serialize(args));
// test static cache
if (!isset($cache[$cid])) {
// test db cache if necessary, CACHE_STATIC indicates no DB cache
if ($expires == CACHE_STATIC || !$cache[$cid] = cache_get('cache_hook_all', $cid))
$cache[$cid] = module_invoke_all();
}
// store to db cache if necessary
if ($expires != CACHE_STATIC) {
cache_set('cache_hook_all',....);
}
}
return $cache[$cid])
}