Ignoring languages such as spanish that distinguish between /ɾ/ and /r/, as such is not what I refer to, are there any languages that would differentiate between say, /p/ and /ppp/. It is a weird concept, but it is something that came to mind. I suppose, with the example I have in mind, the stammer would be realized as [pĭpĭpĭ], if that helps. Recalling back on the first, differentiating between /ɾ/ and /ɾĭɾĭɾĭ/ would be what I am referring to.
I suppose the simplest example would be languages such as latin that use(d) double consonants to differentiate. e.g. anvs, [anus] (ring) vs. annvs, /an.nus~anənʊs~anːus/ (year.)