How to compare 2 matrices of MFCCs, keeping the time information
You are misunderstanding how DTW works. You can actually adjust the frame deletion/insertion costs to adjust how much temporal mismatch you can tolerate.

We would have: DTW("Puuuum pum tchak", "Puuum pum tchak") &lt; DTW("Puuuum pum tchak", "Pum pum tchk") &lt; DTW("Puuuum pum tchak", "Purr purr purr").

That is to say, if there is a sample with a perfectly good timing, it'll always yield a higher DTW score than a sample with the wrong timing. The trade-off between similar timbre and similar timing can be adjusted by tweaking the DTW alignment costs. One useful thing with DTW is that it finds the optimal alignment between the "query" and the found sample - so you can use the path it founds to timestretch/phase-vocode the result and align it perfectly with the query.

It is not clear what kind of sensitivity on timing your application has; which features matter the most (overall timbre? onomatopoeia which is pronounced?); and what kind of processing you could do to the found clips to align them even better with the query. If rhythm/timing is absolutely essential, you might want to process each sample by an onset detector ; and restrict your search to the set of clips which have the right number of onsets, and the correct inter-onset times.

If you have absolutely no tolerance on differences in rhythm, then you could very well compute the average of pairwise distances between the two clips (padded with zeros if their length does not match). That would be a bit silly, but your application might want that.

Finally, if both your query and your samples can accept the same domain-specific representation (say a beatboxed rhythm and a drum loop can both be transcribed into "bass drum" and "snare drum" events) - it might help to transcribe all clips and to match the transcriptions instead of the audio signals.