ENH: to_csv using masking to simplify dtype processing