Custom 404 page - existing plugins?

One request we frequently get is for that page to show a login button in such a case, since logging in could make the topic accessible.