f = Module[{l}, l = Log[#, ConditionalExpression[#2, #2 > 0]] &; With[{Log = l}, #]]&;
f @ Unevaluated @ Plot[Log[27, Sin[2*x] - 1/3*Cos[x]] - 1/3*Log[3, -Cos[x]], {x, -Pi, Pi}]
Alternatively,
g = ConditionalExpression[#, Simplify[FunctionDomain[#, x] /. C[1] -> 0]]&;
Plot[Evaluate[g@Log[27, Sin[2*x] - 1/3*Cos[x]] - 1/3*Log[3, -Cos[x]]], {x, -Pi, Pi}]
same picture