How to use any SMB share for Time Machine backups

For some stupid reason, Apple only allows Time Machine backups to SMB servers that fulfill certain requirements. Some brand name NAS machines work, others don’t. I want to to use my AVM router for backups, but the application won’t let me. Googling reveals some old solutions involving custom scripts – …