South Indian Muslims spoke Malayalam and all those other ancient South Indian languages. Urdu was not produced artificially, it was formed in a natural way when the Persian rulers with Turkish backgrounds interacted with the locals of the region. Meaning Urdu has a significant chunk of Sanskrit, Persian & Arabic. No one is denying the Sanskrit used in Urdu (of course Sanskrit is an older language than Urdu). It came in when locals interacted with the invading rulers. However, there was no language 'Hindi' used at that time that is understandable to average Hindi speakers today.
Persian was the language of the courts in the Indian subcontinent for a long time before it was replaced by Urdu over time.