Basically, to develop "formally" a geomety you have two ways; call them analytic and synthetic respectively.
Analytic
This is our "good old" Analytic geometry :
a point in the space is a ordered triple of real numbers : $(x_1,x_2,x_3)$
a line is the totality of points $(x_1,x_2,x_3)$ such that $u_1x_1 + u_2x_2 + u_3x_3 = 0$,
where at least one $u_j (j = 1,2,3)$ is different from zero
and so on ...
But real numbers are definable in set theory; thus - in principle - you can translate into set-theoretic notation the equation of the line.
Synthetic
See Edwin Moise, Elementary Geometry from an Advanced Standpoint (3rd ed - 1990), page 43 :
space will be regarded as a set $S$; the points of space will be the elements of this set. We will also have given a collection of subsets of $S$, called lines, and another collection of subsets of $S$, called planes.
Thus the structure that we start with is a triplet : $<\mathcal S, \mathcal L, \Pi>$, where the elements of $\mathcal S, \mathcal L, \Pi$, and are called points, lines and planes, respectively.
Our postulates are going to be stated in terms of the sets $\mathcal S, \mathcal L$, and $\Pi$.
Here are the first two postulates :
I-0 : All lines and planes are sets of points.
I-1 : Given any two different points, there is exactly one line containing them [we can "trivially" express the fact that the point $Q$ is contained into the line $l$ with the formula : $Q \in \mathcal S \land l \in \mathcal L \rightarrow Q \in l$ ].
We write $\overline{PQ}$ for the unique line containing $P$ and $Q$.
We define the relation of betweenness between (sic !) three points $P, Q, R$.
Then [see pages 64-65] : if $R,Q$ are two points, the segment between $R$ and $Q$ is the set whose points are $R$ and $Q$, together with all points between $R$ and $Q$.
The ray $\overrightarrow {AB}$ is the set of all points $C$ of the line $\overline {AB}$ such that $A$ is not between $C$ and $B$. The point $A$ is called the end point of the ray $AB$.
An angle is the union of two rays which have the same end point, but do not lie on the same line. If the angle is the union of $\overrightarrow {AB}$ and $\overrightarrow {AC}$, then these rays are called the sides of the angle; the [common] end point $A$ is called the vertex.
Finally, you can "close the circle" between this two approaches.
Assuming that we have defined the set $\mathbb N$ of natural numbers inside set theory [but I prefer to say that we have defined a model of the natural number system], and then the set $\mathbb R$ of real numbers, we can use $\mathbb R^3$ and call it : (three-dimensional) space.
Comment
What have we gained so far ? I think nothing more and nothing less than what we already have with Descartes' discovery of analytic geometry : an "embedding" of the euclidean geometry into the "cartesian plane".
Of course, the "basic" set-theoretic language gives us a powerful tool for expressing also geometrical "facts" : we can write $P \in l$ for : "the point $P$ is contained into line $l$", we can write $l_1 \cap l_2 \ne \emptyset$ for "two lines intersect each other", ...
But I think that speaking of "foundation for most of modern mathematics" can be mesleading.
It is important to state the axiomatic framework the OP is coming from. It appears that they are working within the confines of 'Euclidean Plane Geometry' (a.k.a. high school plane geometry), and not the $\mathbb R \times \mathbb R$ Cartesian Coordinate Space.
The OP's proof is completely valid in that setting, and if carefully argued there is no circular reasoning.
The next section is just for fun.
Another title for the OP's question:
New Proof of Pythagorean Theorem (using the incenter of a triangle)?
(they can erase the picture of the circle).
The OP's proof doesn't rely on the concept of a circle or tangential distances.
A Theory of (tick-marked) Ray Lines could be postulated that describes the plane, and using the OP's logic, the simultaneous truth of the two equations
$$\tag 1 \frac{ar}{2}+\frac{br}{2}+\frac{cr}{2}=\frac{ab}{2}$$
$$\tag 2 (a−r)+(b−r)=c$$
can be argued.
You will find the two-dimensional Pythagorean Theorem to be true if you believe in the following:
$\quad \text{The Bisection of Two Rays Emanating from the Same Point}$
$\quad \text{The Perpendicular Distance From a Point to a Line}$
$\quad \text{The Area of a Rectangle}$
$\quad \text{Similar Triangles}$
$\quad \text{The Area of a Triangle}$
With that under your belt, you prove the following:
Theorem 1: Concurrency of Angle Bisectors of a Triangle.
In a triangle, the angle bisectors intersect at a point that is equidistant from the sides of the triangle; this point is called the incenter of the triangle.
If want to feel more comfortable before throwing out your Compass-and-Straightedge, please read
How to Bisect an Angle Using Only a Ruler
Best Answer
This is a calculus-based proof, but it is very elementary. As a reference, see Keith Ball - An Elementary Introduction to Modern Convex Geometry.
For any $r>0$, let $L(r)$ be the length of a circle with radius $r$ and let $A(r)$ be the enclosed area.
By convexity (which also ensures that $A$ and $L$ are well-defined) $$ L(r)=\lim_{\varepsilon\to 0^+}\frac{A(r+\varepsilon)-A(r)}{\varepsilon}.\tag{$\delta$}$$ Since concentric circles with any radius are homothetic, $A(r) = r^2 A(1)$ and $L(r)=r L(1)$.
On the other hand $(\delta)$ gives $L(r)=\frac{d}{dr}A(r)$, hence $L(1)=\color{red}{2}\,A(1)$.
So we may equivalently define $\pi$ as $A(1)$ or as $\frac{1}{2}L(1)$.
And we have that in $\mathbb{R}^n$ the surface area of the Euclidean unit ball is just $n$ times its volume.
$(\delta)$ also follows from this pictorial argument, where the outer "polygon" is obtained by summing (in the set-sense) a small disk to the inner polygon:
It is visually clear what happens if we let the number of sides go to $+\infty$ while preserving the circum-radii of the inner and outer polygon.