It is my view that the easiest thing for you to do would be to accept the bequest and then immediately hand it over to a charity of your choice.
If there is a specific reason that you do not wish to receive the bequest, you could write to the executor(s) providing your authority to distribute your legacy to the other beneficiaries (assuming there are others) or directing the executor(s) to pay your bequest to a charity or other person or entity on your behalf.