std::string to char const * in python itk for itk.ImageIOBase`

I don’t think you need to set filename on the image_io. You should provide a filename to the file writer. Take a look at this thread.