Whether a flight is a codeshare or not, doesn't really affect the situations you are asking about. Return flights, or multi-city flights, do not impose any requirement for a flight to be booked as a codeshare or not.
A codeshare is merely a marketing device to sell one physisical flight by multiple airlines.
If you book Paris-Dallas-Mexico City, it may be possible to buy the ticket without any codeshares, and you could see, say, AA for PAR-DFW and AA for DFW-MEX, or a codeshare on the short haul, say AY PAR-DFW with AA metal (operating airline) and then AA for DFW-MEX, or any combination up to a codeshare on the short haul together with a codeshare on the long haul.
Things do not change very much when you have a multi-city booking. These could end up as two half-round-trip fares that allow a stopover, or two half-round trip fares plus other end-to-end fares.
Baggage rules are not related to codeshares or marketing airlines, but are based on IATA regulations as you mentioned as well as requirements from particular governments. For example, the DoT in the USA imposes certain baggage requirements.
If you buy multiple tickets, and attempt to transfer luggage from one to another, this is highly dependant on the airlines involved, whether they have interlining ticket agreements and whether they have policies that allow baggage interlining on separate tickets. I think it's too complicated to generalise on this issue.
On a single international ticket there is the US rule
The DOT presented the following requirements for travel to, from, and
within the United States:
- Airlines must apply the baggage
rules of the first airline selected as the Most Significant Carrier
(MSC) throughout a passenger’s entire journey and the amount that
passengers pay for checked bags and other items, such as a pet in
hold, must not vary during their trip
Defintion of MSC as provided by IATA:
MOST SIGNIFICANT CARRIER (MSC)
a) For travel between two or more IATA areas, the carrier performing
carriage on the first sector that crosses from one area to another.
For travel between IATA Tariff sub-areas, the carrier performing
carriage on the first sector that crosses from one sub-area to
c) For travel within an IATA Tariff sub-area, the carrier
performing carriage on the first international sector.
From a non-US airline, Lufthansa provides this:
Most Significant Carrier Rule (MSC)
This rule states that on flights which are operated by several
airlines, the baggage regulations of the airline that operates the
geographically longest or most significant stretch of the journey
The fact that the rule applies to all journeys on one ticket, is not provided. However, some non-US airlines also apply the same rule.