If types are actually allocated using some kind of reference counting and/or standard library list functions, there might be a way of using thing.Last - thing.First and dividing by the size of the type to calculate the number without having to iterate through the list.
Unfortunately, this method can't/shouldn't be used as type instances aren't necessarily allocated contiguously in memory. Instead, each type instance is linked via forward/backward pointers which can be accessed using the Before/After commands.