fix python's get_pluginpref crashing on long strings