What about this:
\def\adef#1{\catcode`#1=13 \bgroup \lccode`\~=`#1\lowercase{\egroup\def~}}
\let\emphOri=\emph
\def\emph{\bgroup\adef({\ifmmode(\else{\rm(}\fi}\adef){\ifmmode)\else{\/\rm)}\fi}\emphA}
\def\emphA#1{\emphOri{#1}\egroup}
\emph{text (text) $\bigl( f(x) + y\bigr)$ text}
If you need to redefine \ithsape too, add the lines:
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\addto\itshape{\adef({\ifmmode(\else{\rm(}\fi}\adef){\ifmmode)\else{\/\rm)}\fi}}
{\itshape text (text) $\bigl( f(x) + y\bigr)$ text}
I mean that this code is more compact and more readable than embrac.sty.
Edit: If you need to give the same behaviour to another braces [square baces, for example], you can try this:
\def\adef#1{\catcode`#1=13 \bgroup \lccode`\~=`#1\lowercase{\egroup\def~}}
\long\def\addto#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\activebraces#1#2{\adef#1{\ifmmode#1\else{\rm#1}\fi}\adef#2{\ifmmode#2\else{\/\rm#2}\fi}}
\let\emphOri=\emph
\def\emph{\bgroup\activebraces()\activebraces[]\emphA}
\def\emphA#1{\emphOri{#1}\egroup}
\addto\itshape{\activebraces()\activebraces[]}
But I warn: this will not probably work with automatically generated braces (aka from biblatex) because these braces are already tokenized in the macro. I didn't try it but I assume this behavior. You need to find the braces in the package and replace them by \rm version or use some package option (for setting the type of braces). I don't know, sorry, I am not LaTeX specialist.
embracdoes not affect brackets in math mode (since v0.5, according to the documentation). As per egreg's comment to How to get upright parentheses in the whole document?, there probably isn't a perfect solution to that. However, jfbu's answer to that question does try to achieve it. – henrique Jun 07 '14 at 00:31\emphin that context puzzling. – barbara beeton Oct 02 '19 at 14:53