Unfortunately, this is unavoidable for the most part because the entity column type has to support multiple value types. It's a BINARY field so scalar values are typically converted to a string when they're saved into the option cache.
It's just something you'll have to account for in your code, unfortunately.