I susppose the number 5874 on the right side of the slide has something to do with the fact that this gun is allowed in Italy under the Italian Gun Act.
I owned the slide of a Walther P38k in caliber 7.65 Luger as an interchangeable system for a Walther P4, where on the right side an additional number was stamped as well.
Then I clearly learned that this second number on the slide allowed the gun in Italy.
As already mentioned, the background to this lies in the Italian weapons law:
In Italy even today all pistols for private owners that have a caliber for current military weapons are banned.
That is why privately owned pistols in the caliber 9mm Luger are prohibited in Italy.
The P38k, from which my slide came, was originally intended for export from Germany to Italy and therefore had a caliber of 7.65 Luger, which was not prohibited and was shown by the additional number on the right side.
As far as I know the 9x21 IMI caliber was even specially developed for Italy in order to be able to export common pistol models to Italy.