This only throws the error when running it with TexLive 2017 on Debian 9. If I run the same example on Windows 10 with MikTex, everything works fine:
\PassOptionsToPackage{main=brazil,english,spanish,french}{babel}
\documentclass[brazilian,brazil,10pt,a4paper,]{memoir}
\usepackage{babel}
\usepackage{hyperref}
\newcommand{\autor}[1]{\author{#1}}
\newcommand{\imprimirautor}{\theauthor}
\newcommand{\brazilword}[1]{\foreignlanguage{brazil}{#1}}
\autor{\brazilword{Your Name}}
\hypersetup{
pdfauthor={\imprimirautor},
}
\begin{document}
Hi.
\end{document}
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)))
! Argument of \bbl@tempd has an extra }.
<inserted text>
\par
l.14 }
? H
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
\protecthelps, but in general it is not a good idea to add lots of complicated commands like\foreignlanguageto stuff that should end in the pdf booksmarks or info dictionary. – Ulrike Fischer Oct 21 '19 at 09:16