The brackets do indicate that that parameter is optional.
bytes
, in particular, has a huge amount of docs, and if you go down further, you can see what it expects the encoding
to be...| | decode(self, /, encoding='utf-8', errors='strict') | Decode the bytes using the codec registered for encoding. | | encoding | The encoding with which to decode the bytes. | errors | The error handling scheme to use for the handling of decoding errors. | The default is 'strict' meaning that decoding errors raise a | UnicodeDecodeError. Other possible values are 'ignore' and 'replace' | as well as any other name registered with codecs.register_error that | can handle UnicodeDecodeErrors.