The Rambam in his Iggeret Shmad, discusses the correct conduct expected of Jews during times of persecution. There were situations where it was forbidden for Jews to practice their religion under fear of death.
Surprisingly, the Rambam gives a lenient ruling where the Shmad of the Muslims merely asked for a verbal recognition of the Prophet Mohammed. The Rambam would call this a mild Shmad. He reasoned that while it is certainly permitted to bribe the enemy in return for survival, one could pay lip service to something false in order to survive.
This view was challenged by other authorities of his generation. In general, the Rambam did not view the Islamic religion as idol worship, since they were monotheistic. He had a bigger problem with Christianity.
He did make a strong point that every Jew must choose to live in a place where he can grow in spirituality and closeness to Hashem. Today, that place would be Israel where spirituality and holiness is greater by far than anywhere in the world.