As you have found, you cannot have a backslash as the last character in a quoted string. Using a character group is the normal trick for the pattern. If you use it in the replacement string it is a literal, not a group. So you could do
mutate {
gsub => [
"PoundedUNC", "#", "\]",
"PoundedUNC", "]", ""
]
}
It does not have to be ], you can use any character that will never appear in the UNC.