What are the renaming rules for files in GitHub Releases?

Files in Releases are renamed if they include special characters.

As a minimal example, in this release I have attached a single file named test~file!!!. Something has renamed this file, replacing the ~ with . and removing the !!! (test~file!!!test.file). This happens when I upload a file with this name. If I then try to edit the filename in Edit release it shows no error but does an even stranger rename (test~file!!!test.file.file).

The motivation here was trying to upload a Debian package, which commonly has semantic tildes in the filename (my-proj_1.0.0~rc1.deb), and finding it surprisingly renamed (breaking a later container-building Action that expected the original name).

What characters are not allowed in these filenames?
Which are removed, and which are renamed?
Where is this documented?
Can these restrictions be removed?