convert optional string to string python