Does anyone know how to remove all metadata from an MKV file?

mkvpropedit --tags all:"" --delete title
should remove all global tags.

To remove tag spam from the single audio, video and subtitle tracks, you’ll have to address those individually. (as far as I know)

see How to remove tag spam and set language in several MKV files at once
It also contains a script for Linux.