You can write like this now.
func Reverse[M ~map[K]V, K comparable, V comparable](m M) map[V]K { r := make(map[V]K, len(m)) for k, v := range m { r[v] = k } return r }