First priority: to prevent the argument from happening
Avoiding getting into an argument would ultimately boil down to avoiding disagreement in the first place. I can think of several ways to help do this.
The first way would be to avoid subjects which you already know you and your interlocutor disagree in. For example, if I know that someone is a staunch advocate of mint-flavored ice-cream and will argue for its superiority at every opportunity, then I'd be better off avoiding the topic of ice-cream altogether (unless I'm interested in having an ice-cream flavor argument/debate, of course).
Another way to avoid arguments is to refrain from voicing your opinion. This tends to make conversation quite drab, though, so it's probably best applied selectively — such as when a contentious topic has unavoidably come up. If there are other people engaged in the conversation, you may be able to sit things out briefly until you think it's safe to resume participation. And if you do find yourself holding the ball, you might still be able to avoid the issue by giving a terse, noncommittal response or by changing the issue.
If all else fails, you can always simply state that you don't want to talk about the subject, which will typically shut things down or otherwise force anyone interested to address you with something different; to continue pressing you for a response after you've explicitly declined would be rude — hence, doing so would demarcate an end to polite discussion.
This brings us to your "second priority".
Second priority: to stop the meaningless argument without hurting Bob too much.
There are a number of ways to end an argument, which can range from civil and polite, to blunt and forceful, to a complete failure of diplomacy and the consequent devolving of a dispute into a mere contest of power. (It seems acceptable to ignore this last case here, since it is likely beyond the scope of this question/forum).
The simplest way would probably be to simply "agree to disagree". This doesn't resolve the disagreement itself, but it succeeds in moving the conversation forwards, which can be especially useful when an issue isn't directly related to what you're discussing and/or when you don't expect an agreement to be reached. And of course you could always choose to feign agreement for the sake of avoiding conflict, although this isn't normally a very good solution...
All other cases, I think, bring things to a matter of rhetoric. That is, failing all these other possible solutions, you will most probably find yourself in an argument, for which the art of rhetoric aims to guide one through the successful navigation of. Since rhetoric is an entire subject on it's own and deserving of its own study, I won't get much into it here; instead I'll simply mention it, emphasize its relevance, and strongly suggest that you acquire some proficiency with it if you haven't already.
Often times disagreements may not be disagreements at all, but merely misunderstandings (often owing to linguistic confusion) which can be cleared up from further explaining what each person means in order to ensure the same terms mean the same thing to the involved parties (this often involves tentatively accepting different definitions than one is used to for the sake of moving discussion beyond unproductive semantic disputes). In the case that there is any real, substantial disagreement between parties, identify what to appeal to. In some cases it may be appropriate to appeal to some authoritative source(s) to establish a matter of fact, or perhaps to turn to logic when defending or point out flaws in reasoning; other times still it may have to be accepted that people simply have different tastes ("de gustibus non est disputandum!"). In any instance, maintaining a civil and non-accusatory tone while doing your best to ignore any immaturity or poor form the other party may be guilty of will help keep things charitable and in good faith; do your best to keep a level head.
There is much more that could be said on the subject, but this answer is already getting pretty long-winded, so I'll go ahead and move on and wrap things up.
Third priority: To continue the conversation we had BEFORE the argument, without restarting the argument.
This third priority seems fairly simple and straightforward compared to the other two.
If, after the first and second priorities have been handled, you still wish to resume the conversation from an earlier point, then you can simply return to the earlier topic; you might say something like "so anyways, now that we're all on the same page about [x], …", or perhaps a transition along the lines of "well, ignoring [x], let's return to the topic of …". And otherwise, there's nothing wrong with letting a conversation end.
I hope this admittedly loquacious answer is at least somewhat helpful. In any case, I wish you the best of luck; hope things go well / improve!