For the purposes of further development of my shortInputForm function, I wish to convert Atomic objects such as Graph into non-atomic Mathematica expressions (not the InputForm strings!) where Graph head itself would be temporarily inactivated. The following obvious method is ugly, highly inefficient, and potentially can have undesirable side-effects:
g = Graph[{UndirectedEdge[1, 2], UndirectedEdge[2, 3], UndirectedEdge[3, 1]}];
ToExpression[StringReplace[ToString[g, InputForm], "Graph" -> "Inactive[Graph]"]]
Is there a better way to "un-evaluate" a Graph object?

Nucleusdoesn't work withNumericArrayandByteArray. Do you have an idea how to make it work? – Alexey Popkov Jan 02 '22 at 08:41Rationals can also not be made compound this way. You can also try other serialization formats such asCompressor WXF (though I think WXF supports NumericArray directly) – Szabolcs Jan 02 '22 at 09:58Uncompress[Compress[expr], HoldComplete]route also doesn't work. So the only way seems to be the good oldToExpression[ToString[expr,InputForm],InputForm,HoldComplete]? – Alexey Popkov Jan 02 '22 at 11:35Numerator/Denominator. – Szabolcs Jan 02 '22 at 11:38ToExpression[ToString[expr,InputForm],InputForm,HoldComplete]won't return the original array in such cases, which should be considered as a bug. – Alexey Popkov Jan 02 '22 at 15:58