STM32 UART character encoding issues (can't decode using either ASCII or UTF-8)
If I do a simple
cat /dev/ttyACM0
I can see the output

So it is working with the default settings of /dev/ttyACM0. You can find out what they are with the stty command. On my PC I get
root@berendilinux:~# stty -a &lt;/dev/ttyUSB0 
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = &lt;undef&gt;; eol2 = &lt;undef&gt;; swtch = &lt;undef&gt;; start = ^Q; stop = ^S;
susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke -flusho -extproc
root@berendilinux:~# 

Run stty -a &lt;/dev/ttyACM0 on your host, and whatever rate it reports would be the baudrate to put in the Python program.
Read man stty for the meaning of the flags. My output contains
`-parenb cs8 -cstopb`

that means no parity, 8 bits, 1 stop bit. Parity is rarely used these days, some hardware does not support it in 8 bits mode at all.