optimized event_to_str