Also, worth adding to the decision making process : the time it would take before a potential hearing. We're speaking months here, and potentially more than a year.
Cf this recent article from CBC :
https://www.cbc.ca/news/politics/federal-courts-immigration-filings-1.7402924
So yeah, apart from the thousands of dollars, the applicant should also understand that, maybe, their application has a good chance to being finalized in the next year or year and a half, before a potential hearing, in which case the points of the hearing becomes moot but the money is gone. Mandamus has to be seen as a relief for exceptional cases, and there have been such cases where applicants wait for 10, 15 years or even more for their application. Unless there's very good reason to think the one year and a half current processing will become years and years with no resolution in sight, better be careful before literally throwing serious money in the trash can.
The vast majority of "mandamus success stories" in the forum were not actual mandamus cases, and people (rightfully so! ) don't disclose their personal details here for stuff that ends up in Canlii.
Not saying all of this to discourage OP or dismiss his situation, after all, a family member of mine is also stuck in security checks for a year an a half or so and it pisses me off, but yeah, lawyering up territory shouldn't be taken lightly, and definitely shouldn't be taken based on what can be seen on a forum, this comment included.