You can figure it out by looking at the equation and using simple dimensional analysis.
$$T_{binary} = 2 \pi \sqrt{\frac{a^3}{G (M_1+M_2)}} $$
We know that $T_{binary}$ needs to be time, $a$ is a unit of distance, and $M_1$ / $M_2$ are units of mass. We can easily look up $G$ to find that it has units of $\frac{m^3}{kg\cdot s^2}$, which are distance cubed over mass and time squared.
Plug that into the equation and get:
$$\text{time} \propto \sqrt{\frac{\text{distance}^3}{\frac{\text{distance}^3}{\text{mass}\cdot\text{time}^2} (\text{mass+mass})}}$$
From here, it's pretty clear that the sum of masses cancels with the mass from $G$, the distances cancel from $a$ to $G$, and you're left with the root of the square of time, hence why you end up with a unit of time.
If you want to add solar masses to Earth masses, you'll have to convert one of them. Let $k=\frac{\text{solar mass}}{\text{Earth mass}}\approx 333000$, then we can turn the sum into $(kM_1+M_2)$. The result of the sum will be Earth masses, so we need the mass in $G$ to be Earth masses.
A standard definition is $G=6.67408\cdot10^{-11} \frac{m^3}{kg\cdot s^2}$, so we need to multiply by an appropriate factor to convert from $\frac{1}{kg}$ to $\frac{1}{\text{Earth mass}}$.
$1\text{ Earth mass}= 5.9736\cdot 10^{24} kg$ $\rightarrow 1=\frac{5.9736\cdot 10^{24} kg}{1 \text{ Earth mass}}$.
Next, you want $a$ in AU, so we need to convert that. $1\text{ AU}=149,597,870,700 m$, which gives us $1=\frac{1\text{ AU}}{149,597,870,700 m}$.
Finally, we need a factor for time. Given the other units, I'm thinking days or years would be appropriate temporal units. Let's say we want days, then $1\text{ day}=86400 s$, giving $1=\frac{86400 s}{1\text{ day}}$.
Now we just need to multiply
$\require{cancel}G\cdot\text{ratio}_{mass}\cdot{\text{ratio}_{distance}}^3\cdot{\text{ratio}_{time}}^2$.
$=6.67408\cdot10^{-11} \frac{\cancel{m}^3}{\cancel{kg}\cdot \cancel{s}^2}$ $\cdot\frac{5.9736\cdot 10^{24} \cancel{kg}}{1 \text{ Earth mass}}$ $\cdot\left(\frac{1\text{ AU}}{149,597,870,700 \cancel{m}}\right)^3$ $\cdot\left(\frac{86400 \cancel{s}}{1\text{ day}}\right)^2$
$=\frac{6.67408\cdot10^{-11}\cdot 5.9736\cdot 10^{24}\cdot 86400^2}{149,597,870,700^3}$ $\cdot\frac{\text{AU}^3}{\text{Earth mass}\cdot\text{days}^2}$
=$8.8895\cdot10^{-10}$ $\cdot\frac{\text{AU}^3}{\text{Earth masses}\cdot\text{days}^2}$
We can plug this into a computer program or calculator using:
$a$ is the semi-major axis, in AU.
$M_1$ is the large body mass, in $M_☉$.
$M_2$ is the small body mass, in $M_🜨$.
$T$ is the orbital period, in Earth days.
$T=2\pi\sqrt{\frac{a^3}{8.8895\cdot10^{-10}(333000\cdot M_1+M_2)}}$
We can bring the numeric portion of $G$ out if we want, for:
$T=2.1074\cdot 10^5\sqrt{\frac{a^3}{333000\cdot M_1+M_2}}$
Voila! We now have an equation that uses custom units. You can do the same thing for any units you want, including made-up units like "the mass of an average Klingon spit-wad", as long as you can convert it to something standardized.
We can sanity check the equation with:
$a=1$ AU.
$M_1=1M_☉$.
$M_2=1M_🜨$.
$T=2.1074\cdot 10^5\sqrt{\frac{1^3}{333000\cdot 1+1}}$
$=2.1074\cdot 10^5 \cdot 1.7329 \cdot 10^{-3}$
$=365.19$ days.
Which is quite close to the 365.242-ish days in a real year.
Obviously, accuracy will depend greatly on how good your source numbers are.