John Calvin does indeed treat this verse. He says:1
By saying אולי, auli, “if peradventure,” he made use of a common mode of speaking. God indeed has perfect knowledge of all events, nor had he any doubt respecting what would take place, when the prophets had discharged their duties; but what is pointed out here, and also condemned, is the obstinacy of the people; as though he had said, that it was indeed difficult to heal those who had grown putrid in their evils, yet he would try to do so.
As to God’s repentance, of which mention is made, there is no need of long explanation. No change belongs to God; but when God is said to turn away his wrath, it is to be understood in a sense suitable to the comprehension of men: in the same way also we are to understand the words, that he repents. (Psalm 85:5; 110:4.) It is at the same time sufficiently evident what God means here, even that he is reconcilable, as soon as men truly turn to him: and thus we see that men cannot be called to repent, until God’s mercy is presented to them.
also deals with this verse and ones like it. He says that the Hebrew 'ulay "may be construed anthropomorphically as God's taking their own way of speaking on his own lips." He finds a parallel with Deut 13:3:2
For the Lord your God is testing you, to know whether you love the Lord your God with all your heart and with all your soul.
The "finding out" language, he notes, is often associated with God's testing:2
God knows how the test, the search, will come out, but the fact does not make the actual test superfluous. Scripture stresses the importance of both divine sovereignty and human responsibility. In some senses, God responds to our responses to him. So our responses to tests are important to God. The gospel itself is such a test, and our response to it is crucial to our relationship with God.
Specifically in relation to Jeremiah 26:3, he writes:2
Here let us simply note that God sometimes announces judgment not for the purpose of describing his eternal plan, but to test the response of people. That test is not complete, of course, until the response actually takes place. Until then, the test is not finished, the results not sealed. Positive and negative responses are still possible. So there is an element of uncertainty that God here expresses by the term "perhaps." [emphasis in original]
Regarding the "relent" language, he quotes the Lord's words in Jeremiah 18:7–10:3
7 If at any time I declare concerning a nation or a kingdom, that I will pluck up and break down and destroy it, 8 and if that nation, concerning which I have spoken, turns from its evil, I will relent of the disaster that I intended to do to it. 9 And if at any time I declare concerning a nation or a kingdom that I will build and plant it, 10 and if it does evil in my sight, not listening to my voice, then I will relent of the good that I had intended to do to it.
Here the Lord states a general policy: many prophecies of judgment and blessing [...] are conditional. God reserves the right to cancel them or reverse them, depending on people's response to the prophet.
We are interpreting [these passages] as expressions of his preceptive will, rather than his decretive: as warnings, not as predictions of what will certainly happen. So there is no question of his decretive will failing. His preceptive will, of course, unlike the decretive, can be disobeyed, but at great cost.
Louis Berkhof treats this language generally, saying,4
And if Scripture speaks of His repenting, changing His intention, and altering His relation to sinner when they repent, we should remember that this is only an anthropopathic way of speaking. In reality the change is not in God, but in man and in man's relations to God.
- Calvin, Commentary on Jeremiah and Lamentations
- Frame, Systematic Theology, pages 320–21
- Frame, Systematic Theology, pages 370–71
- Berkhof, Systematic Theology, 1.1.6.B, page 59