Optimization toString for primitive values