logging and string performance improvements

Sidekick: @lars2893 
FYI: @nathanhumbert 

Several improvements with string allocation and logging.