Abraham
Paul goes to great lengths to show that when Abraham was circumcised there was no Sinai covenant so that covenant could not make void his covenant:
NASB Galatians 3: 15Brethren, I speak in terms of human relations:
even though it is only a man’s covenant, yet when it has been
ratified, no one sets it aside or adds conditions to it. 16Now the
promises were spoken to Abraham and to his seed. He does not say, “And
to seeds,” as referring to many, but rather to one, “And to your
seed,” that is, Christ. 17What I am saying is this: the Law, which
came four hundred and thirty years later, does not invalidate a
covenant previously ratified by God, so as to nullify the promise.
18For if the inheritance is based on law, it is no longer based on a
promise; but God has granted it to Abraham by means of a promise.
Not to mention that Abraham was long dead before the law was given!
Timothy
The best that I can understand Paul considering it inconsequential that Timothy be circumcised is this:
New American Standard Bible
Paul came also to Derbe and to Lystra. And a disciple was there, named Timothy, the son of a Jewish woman who was a believer, but his father was a Greek,
- since his mother was a Jewess, Timothy was a Jew:
https://en.wikipedia.org/wiki/Matrilineality_in_Judaism
- since he was a Jew he was not converting, hence unlike the gentiles who were being told to become Jews in order to become Christians, Tim was doing no such thing:
Acts 15: 1Certain people came down from Judea to Antioch and were
teaching the believers: “Unless you are circumcised, according to the
custom taught by Moses, you cannot be saved.” 2This brought Paul and
Barnabas into sharp dispute and debate with them. So Paul and Barnabas
were appointed, along with some other believers, to go up to Jerusalem
to see the apostles and elders about this question. 3The church sent
them on their way, and as they traveled through Phoenicia and Samaria,
they told how the Gentiles had been converted. This news made all the
believers very glad. 4When they came to Jerusalem, they were welcomed
by the church and the apostles and elders, to whom they reported
everything God had done through them. 5Then some of the believers who
belonged to the party of the Pharisees stood up and said, “The
Gentiles must be circumcised and required to keep the law of Moses.”
6The apostles and elders met to consider this question. 7After much
discussion, Peter got up and addressed them: “Brothers, you know that
some time ago God made a choice among you that the Gentiles might hear
from my lips the message of the gospel and believe. 8God, who knows
the heart, showed that he accepted them by giving the Holy Spirit to
them, just as he did to us. 9He did not discriminate between us and
them, for he purified their hearts by faith. 10Now then, why do you
try to test God by putting on the necks of Gentiles a yoke that
neither we nor our ancestors have been able to bear? 11No! We believe
it is through the grace of our Lord Jesus that we are saved, just as
they are.”
Hence Paul considered the gentile conversion a threat but not Timothy's circumcision:
Galatians 6: 12Those who want to impress people by means of the flesh
are trying to compel you to be circumcised. The only reason they do
this is to avoid being persecuted for the cross of Christ. 13Not even
those who are circumcised keep the law, yet they want you to be
circumcised that they may boast about your circumcision in the flesh.
14May I never boast except in the cross of our Lord Jesus Christ,
through which the world has been crucified to me, and I to the world.
15Neither circumcision nor uncircumcision means anything; what counts
is the new creation. 16Peace and mercy to all who follow this rule—to
the Israel of God. 17From now on, let no one cause me trouble, for I
bear on my body the marks of Jesus.