I'll try to answer without speaking about inexact differentials, leaving only a final comment about them at the very end. Although widespread, the use of that terminology in Thermodynamics is inconsistent with the underlying quantities' mathematical status.
Let start with the "latin $\mathrm d$." In mathematics, it is a symbol usually used for differentials or quantities related to differentials. I avoid entering in details because also the mathematical use of "$\mathrm d$" is sometimes quite ambiguous.
Within thermodynamics, it usually indicates the differential of a function, in practice, the best linear approximation of the difference between the value of a function between two points. For instance, in the case of a function of two variables $F$,
$$
\Delta F= F(X'_1,X'_2)-F(X_1,X_2)= {\mathrm d}F + \mathcal{o}(\{X'_i-X_i\}),
$$
where
$$
{\mathrm d}F=\frac{\partial{F}}{\partial{X_1}}{\mathrm d}X_1 +\frac{\partial{F}}{\partial{X_2}}{\mathrm d}X_2
$$
and
$$
{\mathrm d}X_i=X'_i-X_i.
$$
The adjective infinitesimal applied to the $\mathrm d$'s has the specific (and mathematically well-founded) meaning of small enough that the $\mathcal{o}(\{X'_i-X_i\})$ terms can be safely neglected.
In Thermodynamics, one can get a function of the state by summing two quantities that are not, individually, a function of the state.
A well-known example is internal energy $U$. The physical content of the First principle of Thermodynamics is that the sum of the total heat and work exchanged by a system with the surrounding is a function of the state even if the heat and the work individually depend on the process and not only on initial and final states.
Being $U$ a function of state, we can evaluate and use its differential ${\mathrm d}U$ to express the change of internal energy between two neighboring states. If the process causing such an infinitesimal difference of internal energy corresponds to small exchanged work and heat, it would be nice if the notation would convey such information. However, using something like $ {\mathrm d}w$ and $ {\mathrm d}q$ would be confusing if $ {\mathrm d}$ must represent differences. Therefore, different methods to embed the information that the symbols mean small quantities have been introduced in the thermodynamics literature. Probably the most frequent is to write such small quantities with a $\delta$ or a $ {\mathrm d}$ with a transverse bar.
Such a situation requires a couple of comments.
- From the conceptual point of view, the d- or delta- choices are not necessary and even misleading. Some of the founder fathers did not use them. For instance, Planck, in his treatise on Thermodynamics, writes the first principle as
$$
\mathrm d U = q + w. \tag{1}
$$
I find this notation the most mathematically coherent. I do not think it is a matter of taste. Although small exchanged work and heat should result in a small variation of internal energy, the converse is not necessarily true. This fact would be obfuscated by the d-bar/delta notation if used consistently.
- The most important fact about quantities like $w$ and $q$ (or whatever symbol we want to use) is their functional dependence. Except for the special case of quasistatic and reversible transformations, the exchanged heat and work are not functions of the thermodynamic variables only. This observation implies that an equation $(1)$ we cannot write at all a differential form on the right-hand side. So we are in a case deeply different from the case of a non-integrable differential form like
$$
{\mathrm d}P=P_1(X_1,X_2){\mathrm d}X_1 +P_2(X_1,X_2){\mathrm d}X_2 \tag{2}
$$
where no function of two variables exists such that its differential is ${\mathrm d}P$.
This last point explains why I also think the name inexact differentials is misleading on the same foot it is misleading the use of the $\delta$ symbols: in many cases, the so-called inexact differentials are not differentials at all!