O/P's question was related to the Winchester 1895 in .30 Government aka .30-40
Musket length or musket referred to barrel lengths similar to the older military issue black powder rifles. If you look up the first generation smokeless powder rifles, you will find a very close match to the last generation of black powder rifles. All have barrel lengths from about 29-31 inches or so. Weapons designers simply used the same approximate barrel lengths for the new smokeless powder generation of rifles as they did for black powder rifles.
To get the maximum range for blackpowder firearms of the day, long barrels were necessary. The Springfield Trapdoor in 45/70 for example was 32 inches more or less depending on model, while the newer Krag was 30 inches. You see the same pairing in Mausers, the older 71 and 71/84 had barrels of about 33 inches or so, smokeless Mausers 29.1 as did the GEW 88. And Lee-Metford, Lee-Enfield No. 1 rifles had similar barrel lengths. You find a similar issue regarding length on the older true "muskets" without rifling that the barrels were long to deal with maximizing the use of black powder for long range.
Carbines were designed for special purposes and had shorter barrels accordingly than military infantry issue.
Eventually, the British (Lee Enfield No1, Mk 3) and Americans (1903 Springfield) realized that in their newest generation of smokeless rifles after 1900, that issuing only one intermediate length was a better compromise which was picked up gradually by other countries (the 98 Az series, the K11 Schmidt Rubin, the 1916 Spanish Mauser, and so on). By WWII, most countries had adapted to shorter barrels for their issued rifles either by rebarrelling/shortening existing barrels them, (Belgians, Austrians, Finns, Hungarians, and Spanish), moving to new models (German 98k , Swedes m. 38, Czech VZ 24, Yugo 24/47, French MAS 36, newer Brazilian and Colombian Mausers made by FN, etc. ).
Of the major powers in WWII, only the Japanese with their T38, the Italians with their 91 Fusils, and the Russians with their Mosin 91's and 91/30's, went into WWII with long barreled rifles as general issue and both had the older paradigm of separate carbines. But, the Japanese did move belatedly to the T99 which had the intermediate barrel length during WWII.