Usually, people can't stop the question at "can we go the mandamus route?"
Many, when stuck at IRCC level (and not a third party), have their lawyer make the educated guess that a nudge in the right direction, aka the letter of demand, would be enough for IRCC to just put the application on top of the pile without having to file a leave application at the federal court. In many cases, it happens to be applications which were already relatively close to finalization, but now with an oath a month instead of 4 months later...
Security concerns may go a different way, if there's a good reason it's taking time, well, see you in court, and the applicant better be ready to pay thousands of dollars if it goes well, or possibly lose the case and also pay IRCC's legal fees.
A qualified lawyer should be able to clarify all this to the applicant, based on the specifics of the application (so, during a paid appointment, not some free consultation!), and then, up to OP I guess...