Baseball: Can a pitcher be compelled to pitch?

The umpire doesn’t have to grant time for the batter to do that.

I thought the penalty for taking too long to pitch was a called ball which would leads to walks.

It is, but that’s just dallying around too much and too often. If the pitcher takes this to an unsportsmanlike level, where he is literally preventing the game from proceeding - as the OP proposes is the case - he should, if necessary, be ejected, in accordance with 8.01(d).