optimization: reduce memory usage of %CLASS_ATTRIBUTES

Reduce memory usage of `%CLASS_ATTRIBUTES`: store `undef` as values instead of `1`.