By the way the issue seems to depend to some extend on the fonts. Using Lucida by \setupbodyfont[lucidaot] it is not that obvious but still present. Using Latin Modern it seems that the spacing between the primes changes between f'' and f^{''}. Cambria seems to show that behaviour (like Latin Modern), too, but less obvious.
\unprotect
\definefontfeature
[stixtwo-math-feature]
[kern=yes,
ss01=no, % calligraphic letters
ss02=yes, % lowercase italic variants (e.g. open g)
ss03=no, % hbar und lambdabar variants
ss04=yes, % larger and lower primes, minute etc.
ss05=no, % shorter arrows
ss06=no, % narrower and shorter element and similar symbols
ss07=no, % some smaller operators and emptyset variant
ss08=yes, % upright integrals etc.
ss09=no, % variant negated symbols
ss10=yes, % variants of greater and lesser and similar symbols
ss11=yes, % variant of negated set (inclusion etc.) symbols
ss14=yes, %
ss16=yes] % variants of circled operators
\starttypescriptcollection[Stix2]
\starttypescript [\s!serif] [Stix2] [\s!all]
\definefontsynonym
[Stix2Regular]
[file:STIX2Text-Regular.otf]
\definefontsynonym
[Stix2Bold]
[file:STIX2Text-Bold.otf]
\definefontsynonym
[Stix2Italic]
[file:STIX2Text-Italic.otf]
\definefontsynonym
[Stix2BoldItalic]
[file:STIX2Text-BoldItalic.otf]
\definefontsynonym[\s!Serif] [Stix2Regular] [\s!features=\s!default]
\definefontsynonym[\s!SerifBold] [Stix2Bold] [\s!features=\s!default]
\definefontsynonym[\s!SerifItalic] [Stix2Italic] [\s!features=\s!default]
\definefontsynonym[\s!SerifBoldItalic] [Stix2BoldItalic] [\s!features=\s!default]
\stoptypescript
\starttypescript [\s!math] [Stix2]
\definefontsynonym
[Stix2Math]
[file:STIX2Math.otf]
[features=math\mathsizesuffix]
\definefontsynonym [\s!MathRoman] [Stix2Math] [\s!features={\s!math\mathsizesuffix,mathextra,stixtwo-math-feature},\s!designsize=\s!auto]
\stoptypescript
\starttypescript [Stix2]
\definetypeface [\typescriptone] [\s!rm] [\s!serif] [Stix2] [\s!default]
\definetypeface [\typescriptone] [\s!mm] [\s!math] [Stix2] [\s!default]
\stoptypescript
\stoptypescriptcollection
\protect
\setupbodyfont[Stix2]
\starttext
%
Compare $f'$ to $(f')$ and to $f''$, $(f'')$, $f^{''}$ and $(f^{''})$.
%
\stoptext