If you are a young team, you may want to consider opting for a more modern architecture than this outdated 8-bit MCU. If it has to be an 8-pin package, the following MCUs could be an alternative, which are also available with more flash or a higher temperature range, depending on the variant and your needs:
However, if you absolutely want to stick with the STM8L050J3, you have probably already created a table with the pin functions. It is then quickly apparent that I2C is only possible on pins 7/8, leaving only RX on pin 2 and TX on pin 1 for UART. For debugging, leave the e.g. 5 second delay at the beginning so that you can change the programme. After the delay, pin 1 can then be configured as UART RX and tested. But indeed, in the case of a package where the alternative function is also to be used on the debug pin, debugging is indeed a tedious task.
Good luck!
/Peter