Any side effects of Initialisation and de-initialisation of STM32F0 MCU I2C pin frequently?
In general, it is likely that something unexpected will happen. In your example, both I2C and a UART use the voltages on a pin to convey serial data. The pattern of 1s and 0s for a I2C transmission might look like a valid UART transmission, depending on the I2C and UART data rates.

There are certain situations where you can get away with using one pin for multiple functions, but these require very careful design.