Shouldn't be - checking the code, `write_UI` passes a `\0` to `write_string`, which does seem to use the passed value for padding.
However, if the original read from a file came padded with a space character, pydicom might write that back unchanged if the value had never been accessed (and therefore decoded, forcing pydicom to encode it when writing back).