Pluralization with apostrophes is relatively common as you have noticed, but some authors find it distasteful and some readers find it jarring. Still, it is widespread enough not to be viewed as erroneous, so it is up to you to form your own view on the matter. One work-around is to enclose the variable in quotes, for instance,
If we combine the ‘x’s and the ‘y’s, we obtain ...
This has the disadvantage of introducing inconsistency with unpluralized variables.
Notice that there are many ‘a’s but only one b.
A second option is simply not to use the apostrophe, but if your italic type is similar to your Roman type (or if it is merely an oblique of the Roman), then it may introduce ambiguities.
Compare the many cs with the C-sum, cs.
This can also cause problems for blind users who rely on screen readers.
Alternatively, it may be preferable to rewrite the sentence entirely.
By taking each x in turn, we find that ...
The past (specifically the preterite) tense.
Historically, in English, -'d (or -'t) is how the preterite tense was spelt on all (regular) weak Germanic verbs, with the use of -ed (sometimes -èd in older works) only a relatively recent phenomenon. (It is logical, since we only pronounce the ‘d’ anyway, and using -ed leads to confusion, between words such as learned and learned.)
For instance if you read any Shakespeare, you will see he preferred to use -'d.
What's in a name? That which we call a rose
By any other word would smell as sweet;
So Romeo would, were he not Romeo call'd,
Retain that dear perfection which he owes
Without that title.
As you say, it remains relatively common in modern English where an author has taken a noun, formed it into a verb, and then rendered it into the preterite tense.
The bottleneck was where he
pop'd the variable off the stack.
If we wanted to write this with -ed, we would have to spell it as
poped is pronounced like pope'd). But the assembly instruction is
popp, so this could lead to ambiguity or confusion.