I'll third that.
DeskMini X300 will be the smallest you can get for AM4 APU and it's surprisingly performant.
I'd also recommend the Noctua L9A (or L9I with AM4 bracket if you find it much cheaper).
I ran a 5600G with 2x8GB DDR4 SODIMMs at 4000MHz and it FLIES.
I've since removed the VGA port and put an OCuLink in for access to an easily-removable eGPU option.
If you want smaller, 3D print or purchase a DeskNano kit from msystems to bring it down from 1.92L to 1.2L
I would consider a slightly higher output power brick if you can find a reasonably priced one. The stock one is 120W, which will definitely do the job, but 160-200W will allow you to spin up the CPU/iGPU/RAM as far as you want (Ryzen Master is your friend
) and never hit power limitations.
Similarly, I wouldn't bother with the 5700G for most use-cases, thanks to the 2 extra cores it uses noticeably more power but isn't a huge performance increase above the 5600G, so if you don't get a bigger power brick there's a reasonable chance of random shutdowns due to insufficient power.