I am not sure that simply requiring a free permit would be prohibited. Cities are allowed to require permits for parades or speakers corners even though there is a free speech right that prohibits government interference. Churches still have to get building permits despite the first amendment exercise of religion clause. I wouldn't be surprised to see an argument by the the Illinois Supreme Court hanging its hat on something like since requiring building permits or special zoning for church construction is permitted in spite of the "free exercise" provision of the 1st amendment, so are the FOID provisions.
I hate to say it, but, your logic is a little flawed.
A church building doesn't practice any religion. The people who attend it to, and for one to practice their religion they do not require, or need, any building.
A similar argument can be made regarding the other example.