Ashers in Northern Ireland is appealing a discrimination ruling for refusing to bake the cake which the customer wanted to say 'support gay marriage'.
Since the case came to light, the bakery has received a number of "vexatious" requests, a barrister for the company said.
David Scoffield QC said the bakery had to stop selling cakes with any branding all together for a time because of the requests.
The McArthur family, who run Ashers, are seeking to overturn a court judgment which found they acted unlawfully by rejecting the order placed by LGBT activist Gareth Lee in 2014, according to their religious conviction that the slogan was sinful.
Three senior judges have reserved their verdict after a four-day hearing at the Court of Appeal in Belfast.
Attorney general John Larkin QC said: "A person should not be forced, be it in news print or icing sugar, to be the mouthpiece of A's views where B's views are opposed to those of A."
The Stormont Executive's senior legal advisor has been granted permission to take part in the appeal after arguing that sexual orientation regulations in Northern Ireland discriminate against those like the McArthurs who hold religious or political beliefs.
The McArthur family's barrister David Scoffield QC warned: "If it becomes the easy thing to say 'we only do birthday cakes and we are excluding services', that points to at least partial withdrawal from the marketplace."
The attorney general said the legal argument centred on political expression.
"The problem lies in coerced expression," he said.
"We say it is a very great wrong ...to make someone say something which conflicts with religious beliefs.
"The constitutional law in Northern Ireland means (the bakery) should not have to withdraw from areas for fear of being forced to saying something from which they disagree."
He said to refuse to serve someone because they were gay was "ethically outrageous".
But he maintained that compelling someone to make a product with a message with which they disagreed, in this case endorsing gay marriage, was an entirely different prospect.
The lawyer for Ashers has consistently argued the bakery staff were not aware of the customer's sexuality.
Employees neither knew nor cared whether Mr Lee was gay or straight, it was the message and taking any role in reproducing it that they objected to, he said.
"It was nothing to do with the customer's political opinion. A customer with a different opinion who wanted the same cake would receive precisely the same response."
Lord Justice Ronnie Weatherup asked: "Is it not a belief that this conduct is sinful based on sexual orientation?
"Does that not look like a characteristic which is indissociable from sexual orientation?"
The three judges, including Lord Chief Justice Sir Declan Morgan and Lord Justice Reg Weir, will deliver their judgment at a later date.