http://www.webmd.com/parenting/guide/preschooler-lying-and-honestyAt this point, I would probably take the focus off the lie itself and put it on the reason for the lie. I would play along. "Barbie must be embarrassed that someone else found her #2." "Don't worry, I flushed it down for her so noone else will see it." "Why do you think she left it there? Do you think she forgot or something else?" Then I would work through whatever the issue was from a safe place. If he doesn't feel safe to tell you as himself, you can use Barbie as a teaching moment. You could even say things like, "Barbie should always know that she can tell me if she makes a mistake. I would still love her just as much." And then I would share mistakes you've made in the past and laugh about it together or share your feelings with him.
Most likely he was embarrassed or scared of getting in trouble and that was the reason for the lie (or just having a big imagination). I don't see how getting him in trouble for the lie would make him feel safer confiding in you, although I understand your fear about lying.
It is good to know that it is a common and normal phase rather than deviant behavior. I would wait until he is a little older and the line between imagination and reality is more defined to punish for a lie. And at that point, I would still try to rephrase and not put focus on it.
ex:
A. You forgot to flush your #2, please do so now.
B. It wasn't my #2, it was Barbies.
A. Ok, go flush Barbie's number 2 now, please.
A. Also, I'm pretty sure Barbie doesn't go #2 in the big potty. If it was you, I'd give you a big hug for telling me the truth even if you were worried about how I'd react. That's because I love you and I respect and appreciate people who tell the truth. Anything you want to tell me?
if he says yes, big hug, tell him your proud and know it is hard to tell the truth sometimes, but you're glad he made a great choice. if he doesn't say anything, have him flush the poop and move on with your day.
As they get older, I think the best thing you can do is to demonstrate to him that he has lost your trust. So you don't even say anything in the moment, but you start to double check work or make sure other thing he says are true. IE: He says, "I washed my hands" and then you check to make sure he actually did. I really think he is too young for this... but, when older... Eventually, he will ask, "why don't you believe me, I told you I did." That is your opportunity to say in a casual way, "Oh, well, I noticed a couple things you told me that didn't line up with the truth and now unfortunately, I'm not able to trust your words." You can then briefly explain how after trust is broken it can take awhile to earn back trust. The way to earn it back is to just be honest repeatedly and then eventually you will be able to believe him again. This is a good lesson to earn early in life. It takes just one instant to break trust, but quite awhile to earn it back. This way you don't put him in the situation where he denies lying, but he still has consequences and you let him know you noticed. Avoid getting into a debate on whether he lied or not or when. Just keep it as you started to notice and if he is calm and really wondering (but not arguing) you can give him an example.
Hope that gave you some food for thought.